Hi Ondrej,
Thank you for using Syncfusion controls.
By default, editing related events is not triggered for GridCheckBoxColumn in SfDataGrid, so you can achieve your requirement “Disable editing cells and change their background color” by using converter in GridTemplateColumn with CheckBox.
Please refer the below code example
<syncfusion:GridTemplateColumn MappingName="Conformed">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Conformed}"
IsEnabled="{Binding Conformed, Converter={StaticResourcecheckBoxConverter}}" />
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
<syncfusion:GridTemplateColumn.CellStyle>
<Style TargetType="syncfusion:GridCell">
<Setter Property="Background" Value="{Binding Conformed, Converter = {StaticResource cellbackgroundconverter}}" />
</Style>
</syncfusion:GridTemplateColumn.CellStyle>
</syncfusion:GridTemplateColumn> |
public class CheckBoxConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter,CultureInfo culture)
{
if (value == null)
return false;
return true;
}
public object ConvertBack(object value, Type targetType, object parameter,CultureInfo culture)
{
throw new NotImplementedException();
}
} |
Let us know whether this helps also if you need any further assistance on this.
Regards,
Jagadeesan