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

Gridgroupingcontrol child table values from grandchild table

Thread ID:

Created:

Updated:

Platform:

Replies:

14058 May 17,2004 05:47 PM UTC May 18,2004 12:19 PM UTC WinForms 2
loading
Tags: GridControl
Robert
Asked On May 17, 2004 05:47 PM UTC

In the QueryCellStyleInfo event of a gridgroupingcontrol, I need to disable/enable certain cells in a grandchild level (3rd level) table based on the ChildTable parent value (2nd level). i.e., from the grandchild level, I need to pull info from the CHILD level table (not the top-most level parent). How would you retrieve the childtable parent record information from a grandchild level table (in VB.net)? Thanks, Robert

Administrator [Syncfusion]
Replied On May 18, 2004 05:18 AM UTC

Here is one way you can get at the child table from within the grandchild table.
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
	GridTable table = this.gridGroupingControl1.GetTable("GrandChildTable");
	if(table != null && table.Equals(e.TableCellIdentity.Table) 
		&& e.TableCellIdentity.DisplayElement is GridRecordRow
		&& e.TableCellIdentity.DisplayElement.Kind != DisplayElementKind.AddNewRecord
		)
	{
		GridRecord rec = e.TableCellIdentity.DisplayElement.ParentChildTable.ParentNestedTable.ParentRecord as GridRecord;
		DataRowView drv = rec.GetData() as DataRowView;
		Console.WriteLine(drv["Name"].ToString() + "  " + drv["childID"].ToString()); //some values
	}
} 

Robert
Replied On May 18, 2004 12:19 PM UTC

perfect!! Thanks Clay.

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.

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

;