This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
When you have selected multiple rows and right click on the grid, the selection is cleared. Can you guys make it so that the right click will not clear the row/cell selections? We need to have the context menu to do something on selections. Thanks Gordon |
|
|
Hello Gordon The next nightly build will include an IsRightClickSelectionEnabled property on the DataGrid. If you set this to False, the right mouse button will no longer interfere with the selection. Jason Fauchelle |
|
|
Hi Jason, This is working fine for most cases. But we want to have slightly modification: When the user is focused on a particular cell and then right click on the datagrid, we want it do the selection for that row even we set RightClickSelectionEnabled=False. (at this momemt, the slection on row is empty, so it is easy to fix, I think, or add a new property to set it) Thanks Gordon |
|
|
Hello Gordon You can implement this feature by attaching an event handler to listen to right mouse button clicks on the DataGrid. In the event handler, you can get the item that the mouse is directly over, and use the VisualTreeHelper to look up the visual tree to find the cell that the mouse is over (if any). Then you can set the DataGrid.HighlightedCell property which will highlight the cell, and select the row. Here is some example code:
We can not change the behavior of this feature at the moment as another customer has already started using this. Also, we will not add a new property for this as it will clutter up the API for such a small feature. Let me know if you have questions about implementing this feature at your end. Jason Fauchelle |
|