checkbox in GGC

hi friends i want if i check the checkbox of child table then checkbox of parent table become automatic checked. is there any way for this.

3 Replies

AD Administrator Syncfusion Team May 10, 2006 09:58 AM UTC

Hi, Could you try this code in TableControlCurrentCellChanged Event.Here is a code snippet. Element el = e.TableControl.Table.CurrentElement ; Record child = el as Record ; if(child != null) { object obj = child.GetValue("Check1"); if( obj != null && obj.ToString() != string.Empty) { bool checkValue = (bool)child.GetValue("Check1"); if( checkValue ) { Record Parent = el.ParentChildTable.ParentNestedTable.ParentRecord as Record ; if(Parent != null) { Parent.SetValue("Check",true); } } } } Here is a sample. http://www.syncfusion.com/Support/user/uploads/GetNestedTableValue_7a61a181.zip Please let me know if this helps. Thanks for your interest in Syncfusion Products. Best Regards, Haneef


BR brijeshkhare May 10, 2006 11:33 AM UTC

>Hi, > >Could you try this code in TableControlCurrentCellChanged Event.Here is a code snippet. > >Element el = e.TableControl.Table.CurrentElement ; >Record child = el as Record ; >if(child != null) >{ > object obj = child.GetValue("Check1"); > if( obj != null && obj.ToString() != string.Empty) > { > bool checkValue = (bool)child.GetValue("Check1"); > if( checkValue ) > { > Record Parent = el.ParentChildTable.ParentNestedTable.ParentRecord as Record ; > if(Parent != null) > { > Parent.SetValue("Check",true); > } > } > } >} > >Here is a sample. >http://www.syncfusion.com/Support/user/uploads/GetNestedTableValue_7a61a181.zip > >Please let me know if this helps. > >Thanks for your interest in Syncfusion Products. >Best Regards, >Haneef hi haneef thanks for replay it is working but sometimes it create problem like when you click on 2 times then it checked the checkbox and sometimes it is not checking the parent checkbox .remember that i am also using query value,save value event for both main table and child table .it is in vb.net


AD Administrator Syncfusion Team May 10, 2006 01:46 PM UTC

Hi brijeshkhare, You need to refresh the parent record after changing the value in the TableControlCurrentCellChanged event.Please refer to the attached sample for more details. Here is a sample. http://www.syncfusion.com/Support/user/uploads/UnboundCheckboxGridGroup_3c64883d.zip Could you please run this at your end and let me know how it goes? Thanks for your patience. Best Regards, Haneef

Loader.
Up arrow icon