Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
655
Make all the value editors of the child records read only when the parent record is edited
posted

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?

Parents
No Data
Reply
  • 2426
    Verified Answer
    posted

    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;
    }

Children