Hey,
I am trying to display a column at the far right of the datagrid which would have the total of all the values for each individual row.
I added a datacolumn by setting it's expression property, but, this works only if you change rows for a column. For eg. if I have only one row the total will not update.
I wrote code in the textchanged event of each column, the total goes haywire sometimes..works most of the time...(I do trap the current value of each cell...)
Should I use a combination of both or is there a better and easier way to do this
Also, if there a way to pass a value to the expression property of the datacolumn at runtime...
I have been stuck with this for a while and any help will be highly appreciated...thanks a lot..
arjun

VB.NET DataGrid
Talons
I figured I could sum it up with a combination of "CurrentCellChanged" on the Grid and "RowChanged" on the dataset....
Arjun
gman108362
The user can type in values at runtime and the column needs to be updated simultaneously...
Shamus Xu
Even with execution and bind time, you will still be best off to let the the database engine do a long calculation like that, rather than try to work the values yourself.
malhyp
Even if your datagrid's values aren't coming from a DataSet, whatever you are binding to should allow you to add another field that contains your totals before you populate the grid.
Orlanzo
But, the calculation in my GRID is much faster than processing it in the DB. And I don't have to worry about the user losing his current cursor position.
RomeoChua