如何在datagridview中制作账单 [英] how make bill in datagridview
本文介绍了如何在datagridview中制作账单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在文本框中进行datagridview采访中的总和列
请我帮忙
I want sum column in datagridview interview in textbox
pleass help my Thanks
推荐答案
不确定是在谈论Windows应用程序还是Web应用程序.
无论哪种情况,都需要遍历网格中存在的按行数据.获取列值并将其加起来.
网页中的示例:
Not sure of if you are talking of Windows app or Web app.
In either case, you need to traverse row-wise data present in grid. get the column values and add them up.
Ex in web:
//Something similar to this
int total = 0;
protected void DataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
{
Textbox tbx = (TextBox)e.Row.FindControl("column2textbox");
if (tbx != null)
{
// you got tbx.Text value here. Do any calculation desired.
// total += Convert.ToInt32(tbx.Text) ;
}
}
// After DataBind() event of grid, use this total value to show anywhere.
这篇关于如何在datagridview中制作账单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文