CurrentCellBeginEdit not firing

Hi,


Using the latest version (26.1.35) of the sfDataGrid to show a List<ObjectType>.

I enabled editing on the grid and on 2 checkbox type columns with single click edit.


However, non of the CurrentCell related events fire when I click/change the checkbox.

I tried all of th events below, non are firing


private void grdReservations_CurrentCellValidated(object sender, Syncfusion.WinForms.DataGrid.Events.CurrentCellValidatedEventArgs e)

{

    System.Diagnostics.Trace.Write("grdReservations_CurrentCellValidated");

}


private void grdReservations_CurrentCellEndEdit(object sender, Syncfusion.WinForms.DataGrid.Events.CurrentCellEndEditEventArgs e)

{

    System.Diagnostics.Trace.Write("grdReservations_CurrentCellEndEdit");

}


private void grdReservations_RowValidated(object sender, Syncfusion.WinForms.DataGrid.Events.RowValidatedEventArgs e)

{

    System.Diagnostics.Trace.Write("grdReservations_RowValidated");

}


private void grdReservations_CurrentCellBeginEdit(object sender, Syncfusion.WinForms.DataGrid.Events.CurrentCellBeginEditEventArgs e)

{

    System.Diagnostics.Trace.Write("grdReservations_CurrentCellBeginEdit");

}


private void grdReservations_CurrentCellActivated(object sender, Syncfusion.WinForms.DataGrid.Events.CurrentCellActivatedEventArgs e)

{

    System.Diagnostics.Trace.Write("grdReservations_CurrentCellActivated");

}


3 Replies

MA Manikanda Akash Munisamy Syncfusion Team July 31, 2024 03:03 PM UTC

Hi Sven,

We have reviewed the reported scenario where the GridCheckBoxColumn does not trigger CurrentCell events when the CheckBox state is changed. Since the GridCheckBoxColumn is a non-editable column, it is expected that edit events, such as CurrentCellEndEdit and CurrentCellBeginEdit, will not be executed. 

However, the CurrentCellActivated and CurrentCellActivating events execute as expected based on our testing.

To address validation for the GridCheckBoxColumn, please refer to the user guide section on  Validation for GridCheckBoxColumn.
 
We have attached a sample that we tested for your review. Please examine the attached sample and let us know if you have any additional concerns. If our understanding of your requirement is incorrect or if there are specific aspects of the issue you are facing that we have not addressed, kindly provide further details. This will help us gain a clearer understanding and offer an appropriate solution.

Regards,
Manikanda Akash M

Attachment: SfDataGrid_CheckBoxColumn_337891fb.zip


SV Sven July 31, 2024 03:55 PM UTC

Hi,


Found it a bit bizar that checkbox columns are non editable given that your documentation states otherwise

https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataGrid.GridCheckBoxColumn.html#%22%22

" Represents a column that used to display and edit boolean values and draw CheckBox in its cell."

How do you suppose to show/edit a boolean type column?


I was able to work around with the CellCheckBoxClick.

However still some issues to get the value of my checkbox column.


I tried getting the 'record' to fetch the status of my two checkbox columns with this code :

But the value of checkboxes is not up to date in the data of my record.


Regards,

Sven




MA Manikanda Akash Munisamy Syncfusion Team August 1, 2024 01:51 PM UTC

Hi Sven,

Sorry for the miscommunication. 

We have stated that the GridCheckBoxColumn is considered non-editable because it displays a CheckBox in the cells by default and does not have a separate edit approach to be loaded upon editing. Although the CheckBox state can be changed, it does not have a dedicated edit mode.

In contrast, other columns, such as GridTextColumn, have distinct templates for display and editing. The cell template shows a TextBlock, and when the cell enters the edit state, a TextBox is loaded as the edit element.

In the CheckBoxCellClick event, the e.Record will retain the old value, but you can use the e.NewValue and e.OldValue properties to determine the changes in the CheckBox state. The updated value will be committed only after the CheckBoxCellClick event. You can verify this in the CurrentCellValidated event, where you can access the e.NewValue, e.OldValue, and e.RowData.

For further details, please refer to this user guide: Syncfusion Cell Validation. If you have any other questions or need further assistance, do not hesitate to contact us.

Regards,
Manikanda Akash M

Loader.
Up arrow icon