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.
Unfortunately, activation email could not send to your email. Please try again.

How to find Parent Record of child table

Thread ID:

Created:

Updated:

Platform:

Replies:

117884 Jan 5,2015 08:52 AM Jan 6,2015 04:56 AM Windows Forms 1
loading
Tags: GridGroupingControl
Supriya Varne
Asked On January 5, 2015 08:52 AM

Hi,
I am using Gridgrouping control.
I have Parent-Child Relationship in the control.
I want to change current cell values in child table.
I want to values of  Parent record of current cell of child table when fire the TableControlCurrentCellEditingComplete event.

Please give me solution regarding to this.

Thank you and Regards,
Supriya

Neelakandan Kannan [Syncfusion]
Replied On January 6, 2015 04:56 AM

Hi Supriya,

Thank you for your interest in Syncfusion products.

If you want to get the Parent record for currently edited child table while editing complete, you can use FilteredChildTable property to get the parent record. Please make use of below code,

Code Snippet:

void gridGroupingControl1_TableControlCurrentCellEditingComplete(object sender, GridTableControlEventArgs e)

        {

if (e.TableControl.Table.TableModel.FilteredChildTable!=null)

            {

                //To get Parent Record for currently edited child table

                Record parentRecord = e.TableControl.Table.TableModel.FilteredChildTable.ParentDisplayElement.ParentRecord;

                //To get column values from parent record

                string column1_Value = parentRecord.GetValue("parentID").ToString();

                string column2_Value = parentRecord.GetValue("ParentName").ToString();

                string column3_Value = parentRecord.GetValue("ParentDec").ToString();

            }

        }

Please refer the below sample:

http://www.syncfusion.com/downloads/support/directtrac/117884/Sample_Parent_Record_Value-145439543.zip

Please let me know if you have any concerns.

Regards,

Neelakandan


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.

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.

;