473,396 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 5313
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JP011 | last post by:
Hello I have hit a major road block when it comes to building my dynamic datagrid. To make a long story short I need a dynamic datagrid because my connection string could change and I need the...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
0
by: Pietje de kort | last post by:
Hello, why is the System.Windows.Forms.DataGrid so un-customizable? I am trying to build a DataGrid that will resize it's last column when there is room left over (make it fill the total...
8
by: André Almeida Maldonado | last post by:
Hey Guys... What is the diference in bind data into a datagrid without predefined columns and a datagrid with predifined columns???? When I try to bind data into a datagrid without predefined...
7
by: CanoeGuy | last post by:
I have been trying for the last two weeks to display a dynamic DataGrid. The data that I'm pulling from a SQL Server DB will have whole columns that will be either NULL or 0. I want to display...
6
by: coleenholley | last post by:
Hi All :-) I need to populate a table I created as a web form. Are there any links to show me how to do this? I CANNOT use a dtagrid for this, the table has to be laid out as follows: Header...
2
by: patang | last post by:
I found the following to count the total number of VISIBLE rows of datagrid datagrid.visiblerowcount How do we count the total number of ACTUAL (not just visible) rows of datagrid? Thanks...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
0
by: plzhelpme1 | last post by:
how can i handle dynamic values in grid(ASP.Net and C# )??same like shop billing system..(User typing values in grid ..need to get result in grid itself) i need to calculate column1(No of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.