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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Updating data tables with relations

Thread ID:





56303 Feb 13,2007 12:46 PM UTC Feb 22,2007 08:44 PM UTC WinForms 6
Tags: Grouping
Administrator [Syncfusion]
Asked On February 13, 2007 12:46 PM UTC

In the ManualRelations example, I have tried to update the data tables with new values by clicking on a button to reload the values.

I have not re-instantiated the datatables, but instead cleared all data rows and repopulated with new data.

Unfortunately, this causes the relationships between the parent, child and grandchild tables to stop working. If I click on a row in the parent table, the child table does not update any longer.

Can you please advise?

Administrator [Syncfusion]
Replied On February 14, 2007 01:04 AM UTC

Hi George,

Please refer to the following forum thread for more details.
< a rel='nofollow' href="http://www.syncfusion.com/support/forums/message.aspx?MessageID=54942">http://www.syncfusion.com/support/forums/message.aspx?MessageID=54942

Best regards,

Administrator [Syncfusion]
Replied On February 15, 2007 11:28 AM UTC


Thanks for your response.

Can you please advise how I can select the first row in the Child table when it is loaded with data. I am able to select the first row in the parent table using

if (myDataTable.Rows.Count > 0)

but in the child GGC, the datasource is actually the parent's datasource. The GridTable returned by this.Table gives the parent datatable.

Is there a way to get the child datatable?


Administrator [Syncfusion]
Replied On February 15, 2007 08:18 PM UTC

Hi George,

Please try the below code snippet.

GridTable table = this.gridGroupingControl1.GetTable("ChildTableName");

Best regards,

Administrator [Syncfusion]
Replied On February 16, 2007 05:15 PM UTC


Thanks again, the solution worked.

Going back to my first query, the example you put a link for is for a databoundgrid whereas i am using a gridgroupingcontrol. Can you please show me how to only show certain columns of the related table where the tables are gridgroupingcontrols?

Thanks very much.

Administrator [Syncfusion]
Replied On February 16, 2007 08:16 PM UTC

Hi George,

You can use the VisibleColumns collection property to remove/add/move the column from the grid. Here is a code snippet that shows you "How to remove the columns from the nested table in grid?".

GridRelationDescriptor parentToChildRelationDescriptor = this.gridGroupingControl1.TableDescriptor.Relations["ParentChildRelation"];

Please refer to the attached sample for implementation.

Best regards,

Administrator [Syncfusion]
Replied On February 22, 2007 08:44 PM UTC


Thanks again.

Another issue I am having is that I have two grids. The second grid has several rows, and for each row, there is a column (PRICE) that updates its values constantly (like the trading application demo).

I would like to select the row with a cell value of "PRIM" in the formula column, and then take the value in the PRICE cell and display it in the first grid on the appropriate row, in an unbound/design time added column. This must then update the value constantly aswell to match the second grid.

I have managed to do the following:

GridColumnDescriptor d1 = this.gridGroupingControl1.TableDescriptor.Columns["PrimPrice"];
DataView dv = new DataView(this.gridGroupingControl2.DataTable);
dv.RowFilter = string.Format("[Formula] = '{0}'", "PRIM");
d1.Appearance.AnyRecordFieldCell.DataSource = dv;
d1.Appearance.AnyRecordFieldCell.DisplayMember = "Price";
d1.Appearance.AnyRecordFieldCell.ValueMember = "SpotPrice";
d1.AllowBlink = true;

This fails to show the value.

However, if i change the cell type to a combo box, using d1.Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.ComboBox;

When i click the drop down button, the prim price value appears in the list and also updates accordingly. Can you please explain why i cannot use a standard call type and how i can overcome this issue?


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon