Disable rows on Grid-Edit

Hi,
I have a table with a column named “Status”.
I enabled the grid-edit option on this table but I want to allow edition of rows with just a specific value in “status” field;
My intention is to disable all rows for thoses I don’t want to allow the edition, when clicking “Grid-Edit” button.
Help please…

You may set all fields to disabled (in Row_Rendered server event) so that the data cannot be edited.

hi,That’s not what I want to do. I would like to allow a conditional edition of certain lines following the value of a specific field (named “statut”), of the table.if (mytable->statut->Currentvalue == ‘xxx’){
//disable rows
}Something like that…

Yes I tried the same code on various fields and using the Padlock field value as the controller and the entire column for those fields becomes disabled, not the row.I also just commented out all other code in row_Rendered and the result it the same.

  1. You can only disable all fields, not a row (which is only a HTML table you cannot disable).
  2. Why “commented out all other code in Row_Rendered”? You should write code to disable it, arbei wrote:


You may set all fields to disabled (in Row_Rendered server event) so that the data cannot be edited.

e.g. (Assume v2022)

if (...your condition...) {
  foreach ($this->Fields as $fld) {
    $fld->Disabled = true;
  }
}