HI All,
I want to make all the value editors of the child records for the Parent record read only when the parent record is edited? (in the EditModeEnding event)
Can any one tell me how can i do this?
Hello Prakash,
You would have to somehow keep track of whether or not the parent record has been edited. You can potentially do this by using the Record.Tag property. You can simply set it as a Boolean to true for this purpose.
Then you can use the EditModeStarting event to see if the ParentRecord's Tag property is true. If it is then cancel the event:
void grid_EditModeStarting(object sender, EditModeStartingEventArgs e){ bool isParentEdited = (bool)e.Cell.Record.ParentDataRecord.Tag; if (e.Cell.Record.FieldLayout.Key == "Child" && isParentEdited) e.Cancel = true;}
Thanks Aaron ,
That works great!
Thanks
Prakash