We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to disable the edit mode for certain rows based on specific condition?

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.

XAML:

 

 

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.

C#:

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
2389 07/18/2014 07/18/2014 WPF GridDataControl 4 12.1.0.43
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.