You can disable the edit mode in GridDataControl by using ConditonalFormats or by handling QueryCellInfo event.
Disable edit mode based on condition using ConditionalFormat:
Using ConditionalFormat you can define style for any Row(s)/Cell(s) by editing the Style property in the GridDataConditionalFormat class based on conditions. To disable the edit mode for a Cell/Row, you can set the ReadOnly property in the GridDataStyleInfo class as ‘true’.
Refer the following code example where edit mode is disabled for the entire row if the value in the “Companyname” column is “Syncfusion”. To apply the style for a particular column, you can use the ApplyStyleToColumn property in the GridDataConditionalFormat class.
Disable edit mode based on condition using QueryCellInfo event:
You can also define the style using the “QueryCellInfo” event for any row(s)/cell(s). To disable the edit mode for a Cell/Row, you can set e.Style.ReadOnly as ‘true’.
Refer the following code example where edit mode is disabled for the entire row if the value in the “Companyname” column is “Syncfusion”. To disable edit mode for a particular column/cell(s), the condition is modified using e.Style.CellValue.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:||Product Version:|
or the page will be automatically redirected to sign-in page in 10 seconds.