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

Grid Grouping getting child rows

Thread ID:





36184 Oct 21,2005 04:52 PM UTC Oct 21,2005 08:18 PM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On October 21, 2005 04:52 PM UTC

I am trying to get all the values associated with a given row/record. I have around 10 columns and half of them use mapping tables. How do I given a row iterate thru all of the child tables related to the row? I am trying the following but I never get any nested tables: foreach (NestedTable nt in gridGroupingControl1.Table.Records[nRow].NestedTables) { foreach (Record r in nt.Records) { DataRowView dr = r.GetData() as DataRowView; } }

Administrator [Syncfusion]
Replied On October 21, 2005 05:04 PM UTC

Are you referring to hierarchical parent-child tables? If so, take a look at this thread to see if the code posted there does not give you the information you need. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=33743

Administrator [Syncfusion]
Replied On October 21, 2005 05:58 PM UTC

Well that was esentially what I did and the nested tables collection always seems to be empty. Below is a sample of how I create the child tables, so from the row number how would I iterate the mapping table created below? GridTableDescriptor td = gridGroupingControl1.TableDescriptor; string relationName = m_dv.Table.TableName + "_" + dtMap.TableName; gridGroupingControl1.Engine.SourceListSet.Add(new SourceListSetEntry(dtMap.TableName, dtMap.DefaultView)); //Create the relationship between the main table and the mapping table GridRelationDescriptor rd = new GridRelationDescriptor(relationName); rd.ChildTableName = dtMap.TableName; rd.MappingName = relationName; rd.RelationKind = RelationKind.ForeignKeyKeyWords; rd.RelationKeys.Add("id", "map_id"); td.Relations.Add(rd); //Create the relationship between the mapping table and it''s root table string relationName1 = relationName + "_" + dtBase.TableName; GridRelationDescriptor rd1 = new GridRelationDescriptor(); rd1.ChildTableName = dtBase.TableName; rd1.MappingName = relationName1; rd1.RelationKind = RelationKind.ForeignKeyReference; rd1.RelationKeys.Add("id", "id"); rd.ChildTableDescriptor.Relations.Add(rd1);

Administrator [Syncfusion]
Replied On October 21, 2005 08:18 PM UTC

Well I am going to answer my own question, feel free to correct me if I am way off:) Using the GridRecord I just get the value of the mapping tables id value as an array and iterate thru the values. so... Array array = rec.GetValue("BaseTable_ChildTable_id") as Array;


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

or the page will be automatically redirected to 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