朋友们, 我被困在自己的发展中, 我在Gridview中有一个名为quanity的列,另一个列名为每单位价格, 总计,其中value = quantity * PricePerUnit; 但是我有一个TextChanged Event for Quantity文本框,在上面进行计算并显示在Gridview的总列中. 现在我想要GridviewFooter中(总计)"列的总和.当我在Gridview中的任何行的数量"中输入值时. 需要帮助 问候 Aamir
Hi friends, i am stuck in my development, i have a column named quanity in Gridview and another column name Price per Unit, Total in which value=quantity*PricePerUnit; but i have a TextChanged Event for Quantity textbox on which calculation is done and displayed in total Column of Gridview. now i want the Sum of (Total) Column in GridviewFooter. as i enter the value in Quantity of any row in Gridview. need help regards Aamir
推荐答案尝试一下. csharpdotnetfreak.blogspot/2009/07/display-total- in-gridview-footer.html [ ^ ] try this. csharpdotnetfreak.blogspot/2009/07/display-total-in-gridview-footer.html[^]
此代码将帮助您:- This code will help you:- int total = 0; protected void girdview_OnRowDataBound(object sender, GridViewRowEventArgs e) { if(e.Row.RowType == DataControlRowType.DataRow) { total += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Amount_column")); } if(e.Row.RowType == DataControlRowType.Footer) { Label lblAmount = (Label)e.Row.FindControl("amountLabe"); lblAmount.Text = total.ToString(); } }
祝你好运.
Good luck.
www.dotnetfunda/forums/thread7788-gridview-contol-for-footer-template.aspx [ ^ ] www.telerik. com/community/code-library/aspnet-ajax/grid/calculated-column-with-total-in-footer.aspx [ ^ ] www.dotnetfunda/forums/thread7788-gridview-contol-for-footer-template.aspx[^] www.telerik/community/code-library/aspnet-ajax/grid/calculated-column-with-total-in-footer.aspx[^]
更多推荐
在Gridview页脚中显示总计(列值)的总和
发布评论