I need to capture when a row is clicked, not an individual cell. Looked at header click events but did not find what I need.
How to I capture when a row is selected by clicking the side bar of the grid?
there is a doubleClickRow event.... not sure if that helps you or not.
I was hoping for a RowClick or someway to notify when a row is selected in the grid so I can set a variable to the column value of the newly selected row. Worse case, I will just tell people they need to double click to set the new value of the variable.
How would I capture a single click to the side bar of the grid that selects the row when it's clicked once? The row gets highlighted when the sidebar cell is clicked so I would expect some event is raised.
I have a grid with row selectors set to true. when I click on the row selector, the event - afterRowActivated is raised. within that event, I can examine the .ActiveRow object to get to the cells, as needed.
not sure if that works for you or not.
I think this is where I need to go with this. I will confirm in a minute.
This did the trick.
I really appreciate the help.
you're welcome - have a good one.
Hi,
Clicking anywhere in the row (including on the cells) will cause the row to become the active row and thus will fire Before/AfterRowActivate.The row can also be activated via the keyboard or if the current Position of the BindingManager changes.
So that might not be what you want.
If you want to trap the selection of row (which is not the same as the Activation), then you could use the Before/AfterSelectChange events. Rows can also be selected via the keyboard, though. And a Ctrl+click on a row selector can de-select a row.
If you are explicitly only interesting in trapping actual clicks on the row selector, you would have to use the MouseDown or MouseUp event and use the UIElements.
So it really depend on exactly what you are trying to do.