Hi Ricardo,
You are saving the data using the RowValidated event in SfDataGrid. But
GridCheckBoxColumn is a non-editable column. We have only executed the check or
uncheck the CheckBox control directly in GridCheckBoxColumn. Also, RowValidated
and RowValidating events are not triggered for GridCheckBoxColumn. So, the
reported problem occurs but the reported scenario is not an issue and is
expected behavior.
However, you can overcome this
by marking the current row-validated flag as false using
ValidationHelper.SetCurrentRowValidated method in CurrentCellValueChanged event
as shown below,
|
// Event customization
private void
OngvAccountsCurrentCellValueChanged(object sender, CurrentCellValueChangedEventArgs e)
{
int columnIndex = this.gvAccounts.ResolveToGridVisibleColumnIndex(e.RowColumnIndex.ColumnIndex);
//We are enabling the RowValidating event if the
changes happen in GridCheckBoxColumn
if (this.gvAccounts.Columns[columnIndex].CellType
== "CheckBox")
{
this.gvAccounts.GetValidationHelper().SetCurrentRowValidated(false);
}
}
|
KB Link: https://support.syncfusion.com/kb/article/5634/how-to-fire-rowvalidating-event-for-gridcheckboxcolumn-in-sfdatagrid-in-wpf-
Find the modified sample in the attachment.
Regards,
Vijayarasan S
If this post is helpful, please consider Accepting it as the solution so that
other members can locate it more quickly.
Attachment:
Modified_Sample_94d83c38.zip