Disable cell for edit in normal edit mode

Is there some example about how to disable cell for edit based on some other cell value in the same row? 
I need that for normal edit mode.


Thanks!
Bernard,


3 Replies 1 reply marked as answer

JC Joseph Christ Nithin Issack Syncfusion Team May 19, 2022 01:54 PM UTC

Hi Bernard,


Greetings from Syncfusion support.


   Based on your query, you want to disable edit for a particular cell based on the value of the cell. We can achieve this requirement by disabling the `column.allowEditing` property for the column for the particular value and enabling the same for other values in the `actionBegin` event of the EJ2 grid.


Please refer the below code example:

 

actionBegin {

    var grid = docuemnt.getElementsByClassName('e-grid')[0].ej2_instances[0];

    if (args.requestType === 'beginEdit') {

      if (args.rowData.Freight === 65.83) {

       grid.getColumnByField('Freight').allowEditing = false;

      } else {

       grid.getColumnByField('Freight').allowEditing = true;

      }

    }

  }

 

 


Please get back to us for further details.


Regards,

Joseph I.


Marked as answer

BJ Bernard Jurlina May 20, 2022 08:51 PM UTC

Hi Joseph!

Thanks for the answer, it's working great!


Regards,

Bernard.



JC Joseph Christ Nithin Issack Syncfusion Team May 23, 2022 01:45 PM UTC

Hi Bernard,


  Thanks for your update.


  We are glad that the provided solution resolved your issue.


  Please get back to us for further details.


Regards,

Joseph I.


Loader.
Up arrow icon