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?
ADAdministrator Syncfusion Team 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).
WGWes GoadFebruary 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.
ADAdministrator Syncfusion Team 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.
WGWes GoadFebruary 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.
ADAdministrator Syncfusion Team February 17, 2004 07:28 AM
Here it is in VB.
ADAdministrator Syncfusion Team February 17, 2004 07:30 AM