how to get the event cheked in Syncfusion : GridCheckBoxColumn ?
Thank you for using Syncfusion Products.
We analyzed your query. Due to GridCheckBoxColumn behavior it does not fire any Editing events. Instead of editing events you can use CurrentCellvalueChanged event to get fired when the check box value is changed.
Code Example [C#]:
|
private void grid_CurrentCellValueChanged(object sender, CurrentCellValueChangedEventArgs args) { SfDataGrid grid = sender as SfDataGrid; int columnindex = grid.ResolveToGridVisibleColumnIndex(args.RowColumnIndex.ColumnIndex); var column = grid.Columns[columnindex]; if (column.GetType() == typeof(GridCheckBoxColumn)) { MessageBox.Show("Checkbox value changed "); } |
We have also prepared a sample based on this and you can download the sample from the below location,
Sample: http://www.syncfusion.com/downloads/support/directtrac/145903/ze/DataGrid-1284954582
Please let us know if you have any query.
Regards,
Jai Ganesh S
Hi Luis,
Thank you for using Syncfusion Products.
We analyzed your query. Due to GridCheckBoxColumn behavior it does not fire any Editing events. Instead of editing events you can use CurrentCellvalueChanged event to get fired when the check box value is changed.
Code Example [C#]:
private void grid_CurrentCellValueChanged(object sender, CurrentCellValueChangedEventArgs args)
{
SfDataGrid grid = sender as SfDataGrid;
int columnindex = grid.ResolveToGridVisibleColumnIndex(args.RowColumnIndex.ColumnIndex);
var column = grid.Columns[columnindex];
if (column.GetType() == typeof(GridCheckBoxColumn))
{
MessageBox.Show("Checkbox value changed ");
}
}
We have also prepared a sample based on this and you can download the sample from the below location,
Sample: http://www.syncfusion.com/downloads/support/directtrac/145903/ze/DataGrid-1284954582
Please let us know if you have any query.
Regards,
Jai Ganesh S
Now as I get the value of GridCheckBoxColumn?
You can get the CheckBoxColumn value in CurrentCellValueChanged event by using the Rowindex like the below code example,
Code Example [C#]:
|
private void grid_CurrentCellValueChanged(object sender, CurrentCellValueChangedEventArgs args) { SfDataGrid grid = sender as SfDataGrid; int columnindex = grid.ResolveToGridVisibleColumnIndex(args.RowColumnIndex.ColumnIndex); var column = grid.Columns[columnindex]; if (column.GetType() == typeof(GridCheckBoxColumn)) { var rowIndex = this.grid.ResolveToRecordIndex(args.RowColumnIndex.RowIndex); var record = this.grid.View.Records[rowIndex].Data as Student; var value = record.IsCheck; } |
We have also modified the sample based on this and you can download the sample from the below location,
Sample: http://www.syncfusion.com/downloads/support/directtrac/146186/ze/DataGrid518228312
Regards,
Jai Ganesh S
Thank you for contacting Syncfusion support.
We are unable to get clear details on your issue with the given details. Kindly update us with more clear details on your issue description and its replication procedure to understand the issue at our end. Thereby we could analyze and provide you with the appropriate solution at the earliest.
Regards,
Deivaselvan
|
AddHandler Me.sfDataGrid1.CellCheckBoxClick, AddressOf SfDataGrid1_CellCheckBoxClick
Private Sub SfDataGrid1_CellCheckBoxClick(ByVal sender As Object, ByVal e As CellCheckBoxClickEventArgs)
MessageBox.Show("OldValueStatus " & e.OldValue.ToString() & vbCrLf & "NewValueStatus " & e.NewValue.ToString())
End Sub |
- 7 Replies
- 6 Participants
-
LF Luis Fernando
- Oct 26, 2015 08:51 PM UTC
- Jan 7, 2020 12:10 PM UTC