The BeginEdit and EndEdit events are not triggered when you check or uncheck the CheckBox control in GridCheckBoxColumn in WinUI DataGrid (SfDataGrid). However, you can get the notification while changing the CheckBox state by using the CurrentCellValueChanged event.
//Event subscription
this.dataGrid.CurrentCellValueChanged += OnCurrentCellValueChanged;
//Event customization
public void OnCurrentCellValueChanged(object sender, CurrentCellValueChangedEventArgs args)
{
int columnindex = dataGrid.ResolveToGridVisibleColumnIndex(args.RowColumnIndex.ColumnIndex);
if (columnindex < 0)
return;
var column = dataGrid.Columns[columnindex];
if (column is GridCheckBoxColumn)
{
var rowIndex = this.dataGrid.ResolveToRecordIndex(args.RowColumnIndex.RowIndex);
if (rowIndex < 0)
return;
RecordEntry record = null;
if (this.dataGrid.View != null)
{
if (this.dataGrid.View.TopLevelGroup != null)
{
//Get the record when grouping applied in SfDataGrid
record = (this.dataGrid.View.TopLevelGroup.DisplayElements[rowIndex] as RecordEntry);
}
else
{
record = this.dataGrid.View.Records[rowIndex] as RecordEntry;
}
if (record != null)
{
//Checkbox property changed value is stored here.
var value = (record.Data as OrderInfo).Review;
}
}
}
}
Take a moment to peruse the WinUI DataGrid - Column Types documentation, to learn more about column types with code examples.