本文介绍了如何计算从gridview或数据表到标签中的净额?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我需要这里的帮助
我有一个updatr按钮,它可以更改计数和总数
这样的
受保护的 void btnUpdate_Click1(对象发件人,EventArgs e) { // 尝试 // { for ( int i = 0 ; i < GridView2.Rows.Count; i ++) { TextBox Tb =(TextBox)GridView2.Rows [i] .FindControl(" TextBoxCount" ); Basket_DataTable.Rows [i] [" count" ] = Tb.Text; Basket_DataTable.Rows [i] [" 总计" ] = Convert.ToInt32(Tb.Text)*转换.ToInt32(Basket_DataTable.Rows [i] [" 销售价格" ]); }
当我也单击更新"按钮时,我也想通过获得总数的总和来获得总净额.我该怎么做?标签id ="Label2" runat =服务器" text =<%#Eval(" sellingprice)& lt; br =""mode =" hold& gt; in =""grid ="视图=" you =" need =" to =" get =" value =" like =" this =" ..... after =" that =" pass =" in = " update =" button =" event ="和=" calculate& lt; =" xml& gt;"=""xmlns:asp ="#unknown>
Hi all
I need some help here
I have an updatr button it change the count and the total
like that
protected void btnUpdate_Click1(object sender, EventArgs e) { // try //{ for (int i = 0; i < GridView2.Rows.Count; i++) { TextBox Tb = (TextBox)GridView2.Rows[i].FindControl("TextBoxCount"); Basket_DataTable.Rows[i]["count"] = Tb.Text; Basket_DataTable.Rows[i]["Total"] = Convert.ToInt32(Tb.Text) * Convert.ToInt32(Basket_DataTable.Rows[i]["SellingPrice"]); }
I want also to get the net total when I click into update button too by getting the sum of total How can I do it???
解决方案
这篇关于如何计算从gridview或数据表到标签中的净额?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!