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.

Parent of child record

Thread ID:

Created:

Updated:

Platform:

Replies:

75452 Jul 25,2008 05:57 PM Jul 28,2008 07:13 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 25, 2008 05:57 PM

Hello,

I am using a grid grouping control
The grid consists of two table, one table is the child of the other.

when the currentcellacceptedchanges event is called from a field in the child table i need to check the values in the parent row for that table.

Is there any way to do that in the currentcellacceptedchanges event?

+Row1|Column2|Column3
+Row2|Column2|Column3
-Row3|Column2|Column3
subRow1|Column2
subRow2|Column2

For example Rows 1 2 and 3 are in the parent table.
Row 3 is expanded
subrow1 and 2 are in the child table of row 3
If someone changes a value in column 2 of subrow 2, I want to be able to find the values in row3 when the the currentcellacceptedchanges event fires for subrow2 column 2

Is this possible?

Thanks


Administrator [Syncfusion]
Replied On July 25, 2008 06:37 PM

Try code like this.

void gridGroupingControl1_TableControlCurrentCellAcceptedChanges(object sender, GridTableControlCancelEventArgs e)
{
GridCurrentCell cc = e.TableControl.GetNestedCurrentCell();
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);
Record childRecord = style.TableCellIdentity.DisplayElement.GetRecord();
if (childRecord != null)
{
GridRecord parentRecord = childRecord.ParentChildTable.ParentDisplayElement.GetRecord() as GridRecord;
if (parentRecord != null)
{
Console.WriteLine(parentRecord); //use parentRecord.GetValue(columnName) to get a particular value
}
}
}




Administrator [Syncfusion]
Replied On July 28, 2008 07:13 PM

Thanks for the reply.

The showed me exactly what I needed to do.


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.

;