This is just bizarre. It’s almost as if there are certain cells in the grid that are turned off. The whole thing was generated using “drag & drop”, e.g. the grid is bound to a datasource and it works almost all the time.
I can click around time after time and it works perfectly but there are cells in the grid that don’t fire the event. It is completely repeatable, the dataset is fixed.
What could possibly cause this behavior? No exceptions are being thrown, debugger is set to break on all…
Thanks for any advice.
The CellContentClick event is only fired when the contents (the hosted control) of the cell is clicked. This means that the white space around the control does not cause the event to fire.
This is most obvious with a CheckBox cell – the only thing that fires the event is clicking on the CheckBox – however it occurs for all cell types. With a TextBoxColumn for example the event only fires when the text is clicked on.
If you want to know when anywhere in the cell is clicked, use the CellClick or possibly CellMouseDown events instead.
The
CellContextClickevent is generally for columns like the checkbox, button or link, where the mouse interaction with the actual content, not the whitespace, is what you are after.