We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How do I get the current record from the TableControlCheckBoxClick event

I have a bool value in the datasource that maps to a CheckBox CellType.

When the user click the checkbox, I want to be able to get the current record and also be able to cancel the event if any changes were made. Is this the event that I used and if it is how, do I go about doing this.

BTW, the fllw snippet that I have in my TableControlCheckBoxClick event below is returning null for the Record.


Record rec1 = e.TableControl.Table.DisplayElements[e.Inner.RowIndex].ParentRecord;

GridRecordRow rec2 = this.gridGroupingControl3.Table.DisplayElements[e.Inner.RowIndex] as GridRecordRow;

1 Reply

AD Administrator Syncfusion Team December 18, 2006 06:42 AM UTC

Hi James,

We would recommend using the RecordValueChanging event in your case. This event will be triggered on change of the record value.

The check box value can be retrieved by getting the e.NewValue and conditionally check with column name (e.Column). In the conditional loop, the new value can be saved or cancelled using e.Cancel property.

>>>>>>>>>>>>>>>
// RecordValueChanging properties
e.Column // Gets the column name of the cell being changed
e.Cancel // To cancel the event
e.NewValue // Gets the CellValue of the record changed
e.Record // Record being changed
>>>>>>>>>>>>>>>

Kindly let us know if you need any further assistance.

Best regards,
Madhan

Loader.
Live Chat Icon For mobile
Up arrow icon