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. Image for the cookie policy date
close icon

How to set RelationField''s value in GridGroupingControl?

The following is my code:

void ParentGrouping_SourceListRecordChanged(object sender, Syncfusion.Grouping.RecordChangedEventArgs e)
{
......
e.Record.SetValue("ID", -e.OldIndex);
......
}

I found if I set value for the field "ID",then after the end of this event ,there will be no change in grid.
If I remove that line ,there will be a new row added in grid,i accept.

I want to modify "ID" to a random number due to Column "ID" linked child table to parent,if I don't do this,I can only New one parent record once.

Please help me!

1 Reply

HA haneefm Syncfusion Team May 30, 2007 05:41 PM UTC

Hi Ken,

You can handle the CurrentRecordContextChange event to modify the relation field values in a grid. Here is a code snippet.

private void gridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
{
if( e.Action == CurrentRecordAction.EndEditCalled )
e.Record.GetRecord().SetValue("D",1222);
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon