I have a gridview in which I have added a GridViewCheckBoxColumn
I have not found which event is fired when I click on the check box and how to get the value of the checkbos (checked or not) without leaving the cell.
In other word how can I catch the click on the check bos and test its value.
the CellValueChanged event is fired only when I leave the cell ...
the CellClick Event allows me to get the cell but not the checkbox value ..
Any idea ?
Thanks in advance
8 Answers, 1 is accepted
Have you tried handling the ValueChanged event?
I forgot to add where the value checkState comes from.
Hello thanks for your information
Yes I have tried the valuechanged event, but is is fired when I "leave" the cell that contains the CheckBox, I would like an event that is fired when I click the checkbox, without leaving the cell and a property that tells me if the checkbox is checked or not.
OK thanks to your input I found the solution:
1. I Declare a checkEditor
Private WithEvents Checkeditor As RadCheckBoxEditor
2. In the CellEditorInitialized event I instanciate the checkbox
If TypeOf e.ActiveEditor Is RadCheckBoxEditor Then
Checkeditor = e.ActiveEditor
3. The CheckEditor has an event ValueChanged that is fired a every click in the check box and
the checkeditor.value property is "off" or "on", combined with the grid currentrow I have all I need
Thanks for your suggestions that have sent me in the right direction
I am glad that you have discussed the scenario with clicking a cell inside a GridViewCheckBoxColumn.
However, please have in mind that the GridViewCheckBoxColumn offers the EditMode property. This property determines whether changing a value of a check box will immediately be send to the cell (OnValueChange) or when the current cell is changed or the grid is being validated (OnCellChangeOrValidating). Feel free to set the EditMode property to OnValueChange and handle the CellValueChanged event. In this case, the event will be fired as soon as you click a checkbox.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Dess | Tech Support Engineer, Sr.
Thanks for this complement of information, it clearly is a more straight forward mechanism to handle the Click Event on the checkBox.
I will modify my code to handle the click event as you suggest