如何获取数据网格视图的总和值会在不同的行和不同的列中输入值 [英] How to get sum values for data grid view enters values in different rows and different columns
问题描述
我正在使用c#2010创建Windows应用程序 - 在我的应用程序中使用我是数据网格视图,
我在数据网格视图中创建三列
Ex
Slno mts cms
我输入的值不同
示例:First我输入'mts'的值和第二行我为'cms'输入值
这样我输入值和更多行。
我想要如何汇总文本框中显示的总价值
给我任何一个想法。
我尝试过:
如何获取数据网格视图的总和值输入不同行和不同列中的值
I am creating windows application using c# 2010 – in my application using I am data grid view,
I am create three columns in my data grid view
Ex
Slno mts cms
I am enter values differently
Example: First row I am enter value for ‘mts’ and second row I am enter value for ‘cms’
This way to I am enter values and many more rows.
I want how to sum the total values shown on text box
Give me any one ideas.
What I have tried:
How to get sum values for data grid view enters values in different rows and different columns
推荐答案
遍历每一行,将每列中的值添加到相应的总计中。处理完所有行后,您可以在任何地方显示总计。
Iterate through each row adding the values in each column to a corresponding total. When you have processed all rows then you can display the totals wherever you want.
这篇关于如何获取数据网格视图的总和值会在不同的行和不同的列中输入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!