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

child grid

Thread ID:

Created:

Updated:

Platform:

Replies:

43416 Apr 22,2006 10:15 AM UTC Apr 25,2006 09:51 AM UTC WinForms 4
loading
Tags: GridControl
brijeshkhare
Asked On April 22, 2006 10:15 AM UTC

hi friends, i am using grid grouping control for displaying the nested data from database and i am using checkbox on child table so i want information of parent record which have child record with checked check box in child grid on button click plz help

Administrator [Syncfusion]
Replied On April 24, 2006 06:32 AM UTC

Hi, Colud you try this code to get the parent record which have child record with checked check box in child grid .Here is a code snippet GridTableControl tc = this.gridGroupingControl1.GetTableControl( "ParentTable"); string s = string.Empty; string parents = string.Empty; foreach(Record r1 in tc.Table.Records) { foreach(Record r in r1.NestedTables[0].ChildTable.Records) { object obj = r.GetValue("Check1") ; if( obj != null && obj.ToString() != string.Empty) { bool checkValue = (bool)r.GetValue("Check1"); if( checkValue ) { s += r.Info + Environment.NewLine; if( r1 != null) parents += r1.Info; } } } } MessageBox.Show( "Child Record Details:"+ Environment.NewLine +s + Environment.NewLine + Environment.NewLine + "Parent Record Details:" + Environment.NewLine + parents , "Checked CheckBox Records"); Here is a sample. http://www.syncfusion.com/Support/user/uploads/GetNestedTableValue_344224e.zip Please let me know if you need any further assistance. Regards, Haneef

brijeshkhare
Replied On April 24, 2006 08:56 AM UTC

>Hi, > >Colud you try this code to get the parent record which have child record with checked check box in child grid .Here is a code snippet > >GridTableControl tc = this.gridGroupingControl1.GetTableControl( "ParentTable"); >string s = string.Empty; >string parents = string.Empty; >foreach(Record r1 in tc.Table.Records) >{ > foreach(Record r in r1.NestedTables[0].ChildTable.Records) > { > object obj = r.GetValue("Check1") ; > if( obj != null && obj.ToString() != string.Empty) > { > bool checkValue = (bool)r.GetValue("Check1"); > if( checkValue ) > { > s += r.Info + Environment.NewLine; > if( r1 != null) > parents += r1.Info; > } > } > } >} >MessageBox.Show( "Child Record Details:"+ Environment.NewLine +s + Environment.NewLine + Environment.NewLine + "Parent Record Details:" + Environment.NewLine + parents , "Checked CheckBox Records"); > >Here is a sample. >http://www.syncfusion.com/Support/user/uploads/GetNestedTableValue_344224e.zip > >Please let me know if you need any further assistance. >Regards, >Haneef hi Haneef i have tried this code but there is a problem Dim tc As GridTableControl = Me.dgPlanDuplicator.GetTableControl("User_Master") but tc contain nothing so in this line For Each r In tc.Table.Records there is an error of object reference not set and remember that i do not have any checkbox on parent table. plz give the solution

Administrator [Syncfusion]
Replied On April 24, 2006 09:39 AM UTC

Hi, GetTableControl method takes the name of the DataTable as argument. It will not accept the name of the dataset as argument.Please try this code Dim tc As GridTableControl = Me.dgPlanDuplicator.TableControl; Here is a modified sample in VB.Net http://www.syncfusion.com/Support/user/uploads/VB_101a14d3.zip Let me know if this helps. Thanks for choosing Syncfusion Products Regards, Haneef

brijeshkhare
Replied On April 25, 2006 09:51 AM UTC

>Hi, > >GetTableControl method takes the name of the DataTable as argument. It will not accept the name of the dataset as argument.Please try this code > >Dim tc As GridTableControl = Me.dgPlanDuplicator.TableControl; > >Here is a modified sample in VB.Net >http://www.syncfusion.com/Support/user/uploads/VB_101a14d3.zip > >Let me know if this helps. > >Thanks for choosing Syncfusion Products >Regards, >Haneef thanks Haneef its working fine

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.

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

;