469,636 Members | 1,544 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,636 developers. It's quick & easy.

datagrid dynamic total row

Jon
I have a datagrid with a total row on the bottom. What is the best
method to "instantly" update the total row when the value of any row
changes. I am running into problems when I use the column changed
event to calculate the total and assign it directly to the grid ->
myDataGridObject[totalrow,colIdx]=newTotal. When I do this, more
change events are fired, causing unwanted consequences.
Nov 16 '05 #1
2 5208
Jon,

What I would do is place an if statement around the code that updates
the data grid, updating the total row only if the value that changed was not
the total row itself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon" <jo*@ferrand.com> wrote in message
news:56**************************@posting.google.c om...
I have a datagrid with a total row on the bottom. What is the best
method to "instantly" update the total row when the value of any row
changes. I am running into problems when I use the column changed
event to calculate the total and assign it directly to the grid ->
myDataGridObject[totalrow,colIdx]=newTotal. When I do this, more
change events are fired, causing unwanted consequences.

Nov 16 '05 #2
Jon
The if statement is no problem. I guess the issue is that I am
updating the total row with a call to my datagrid object, ie
myDataGrid[totalRowIdx,curCol]=totalValue. The issue is that this
then triggers recursive calls to the columnchanging event and I get
lost in la la land. The crux of the question is, in what event should
do the calculation, and to what should I assign the new value -> the
datagrid or the underlying dataview structure...

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:<ee**************@TK2MSFTNGP10.phx.gbl>...
Jon,

What I would do is place an if statement around the code that updates
the data grid, updating the total row only if the value that changed was not
the total row itself.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon" <jo*@ferrand.com> wrote in message
news:56**************************@posting.google.c om...
I have a datagrid with a total row on the bottom. What is the best
method to "instantly" update the total row when the value of any row
changes. I am running into problems when I use the column changed
event to calculate the total and assign it directly to the grid ->
myDataGridObject[totalrow,colIdx]=newTotal. When I do this, more
change events are fired, causing unwanted consequences.

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by JP011 | last post: by
1 post views Thread by Nathan Bloomfield | last post: by
reply views Thread by Pietje de kort | last post: by
8 posts views Thread by André Almeida Maldonado | last post: by
7 posts views Thread by CanoeGuy | last post: by
6 posts views Thread by coleenholley | last post: by
2 posts views Thread by deejayquai | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.