Getting Grid Records

Hi, I have a ggc with a P-C relationship. I need to get all the parent filtered records and child filtered records so that I can put them into a dataset for further processing? BackGround: Essentailly, my grid shows the user data that they can then select via a checkbox and I need to then get all the checked parents and children and pass it to a web service via a dataset so that the user will receive the selected records. What is the proper method of doing this. Regards, Chris Wescott

1 Reply

AD Administrator Syncfusion Team April 26, 2006 04:10 AM UTC

Hi Chris, Colud you try this code to get the checked checkbox value record in a 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) { object obje = r1.GetValue("Check") ; if( obje != null && obje.ToString() != string.Empty) { bool checkValue = (bool)r1.GetValue("Check"); if( checkValue ) { parents += r1.Info + Environment.NewLine; } } 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; } } } } 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_19c0576.zip For more details, See the forum thread. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=43416 Please let me know if you need any further assistance. Regards, Haneef

Loader.
Up arrow icon