Form disable row

I want to disable (Non - Editable or Greyout) a complete Record ( Row ) in a Form by Unchecking a Check BOX in that record. In my code disable all record of the form.

I wrote this in the active method of the datasource

if(MyTable.ChechBox==NoYes::Yes)
{    
    MyTable_ds.allowedit(false);    

}

It looks all right, but don’t forget to enable editing again if the checkbox isn’t ticked.

MyTable_ds.allowEdit(MyTable.ChechBox == NoYes::No);

Although didn’t you say that you wanted disable editing by unchecking the box? That would be the opposite condition.