I need to show the sum of the count
column from this datagridview
, but I don't know how I can get to the data in the datagridview.
When I click on the button, I want to show 94
in label1
.
How can this be done?
I need to show the sum of the count
column from this datagridview
, but I don't know how I can get to the data in the datagridview.
When I click on the button, I want to show 94
in label1
.
How can this be done?
Use LINQ if you can.
you can do it better with two datagridview, you add the same datasource , hide the headers of the second, set the height of the second = to the height of the rows of the first, turn off all resizable atributes of the second, synchronize the scrollbars of both, only horizontal, put the second on the botton of the first etc.
take a look:
Fast and clean way using LINQ
verified on VS2013
If your grid is bound to a
DataTable
, I believe you can just do:If it isn't bound to a table, you could easily make it so: