Category / Section
How to fire RowValidating event for GridCheckBoxColumn in SfDataGrid
1 min read
You can fire the validation events for GridCheckBoxColumn by marking current row validated flag as false using ValidationHelper.SetCurrentRowValidated method in CurrentCellValueChanged event.
C#:
void sfGrid_CurrentCellValueChanged(object sender, Syncfusion.UI.Xaml.Grid.CurrentCellValueChangedEventArgs args) { int columnIndex = this.sfGrid.ResolveToGridVisibleColumnIndex(args.RowColumnIndex.ColumnIndex); //We are enabling the RowValidating event if the changes happen in GridCheckBoxColumn if (this.sfGrid.Columns[columnIndex].CellType == "CheckBox") { this.sfGrid.GetValidationHelper().SetCurrentRowValidated(false); } }
Samples: