We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Summing DataBoundGrid column values

Thread ID:

Created:

Updated:

Platform:

Replies:

10856 Feb 13,2004 11:28 AM Feb 17,2004 01:08 PM Windows Forms 7
loading
Tags: GridControl
Wes Goad
Asked On February 13, 2004 11:28 AM

I have attempted every way I can imagine to sum the column values in a DataBoundGrid and I am getting no where. I have a Master-Detail type form in VB that displays four columns in a grid. I tried to programmatically set up the grid as Master-Detail, but the data member value would not take. I ended up setting the Data Value Member in the Grid properties to make it work. The row count varies with each transaction number. I would like to sum the values of the fourth column and display that sum in a text box whenever the master transaction number changes. I inserted a GridAwareTextBox, but I cannot find any documentation for it. Can you please guide me to a method that will get the results I need?

Administrator [Syncfusion]
Replied On February 13, 2004 06:19 PM

I am not clear on what you are describing as far as the Master-Details goes. What comes to mid for me is 2 grids, a master grid and a details grid. Clicking in the master, sets the data in teh details. If you set things up using a DataSet with two DataTables and a Relation, then you can implement a Master-Details as two grid by setting DataSource/DataMember on the grids. Here is a sample that shows master-details-details (three grids and two relations). Here is that sample modified with a column of numbers in each grid, and labels on the form holding the sum of those columns. It does this by adding up the values whenever you type into one of the columns, or when you cahnge the parent grid (forcing new content into the child grid). TripleMasterDetailsWithSum_8627.zip

Wes Goad
Replied On February 17, 2004 05:51 AM

You are correct about the Master-Detail I have set up. As the transaction number changes, the grid is filled with the information based on a relationship. My problem is that once the data is filled in the grid, I would like to sum the values and put the summed value in a textbox. I converted a VB 6.0 program to VB.net. The former version had the Flexgrid which I used to sum the values and place the summed value in a textbox. All of my code is written to respond to the value in the textbox. I purchased the Sycnfusion product because I understood that it would provide me the opportunity to do the same. I just can''t find the right syntax in my code to perform this.

Administrator [Syncfusion]
Replied On February 17, 2004 06:40 AM

Is there some reason the code in the sample I sent will not serve your purpose? The sample uses a Label, but you can change it to a TextBox.

Wes Goad
Replied On February 17, 2004 07:12 AM

It should work great, except I was wondering if you have that in VB Code? >Is there some reason the code in the sample I sent will not serve your purpose? The sample uses a Label, but you can change it to a TextBox.

Administrator [Syncfusion]
Replied On February 17, 2004 07:28 AM

Here it is in VB.

Administrator [Syncfusion]
Replied On February 17, 2004 07:30 AM

Sorry. I clicked the wrong button. Here it is in VB.

Wes Goad
Replied On February 17, 2004 01:08 PM

That did it! Thanks for your help.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;