Home › Forums › WPF controls › Xceed DataGrid for WPF › How to select row?
1.I have a grid. It’s in TableView. By default, when I click left mouse button on a row it becomes selected. I want to do the same for right mouse button. How to do this?
2. If I know cursor coordinates, how to get Item (DataRowView, or it’s index in Items) which is under it? Is there any analog to ListView’s GetItemAt() ?
Imported from legacy forums. Posted by it4.kp (had 628 views)
You can handle the PreviewMouseRightButtonDown event for each DataRow and add it to the selected items from there.
Imported from legacy forums. Posted by Jenny [Xceed] (had 220 views)
Thanks for your reply, but I’m not quite get what you mean.How can I handle some event for each DataRow?Do I need to redefine ItemContainerStyle for DataGridControl ?
Imported from legacy forums. Posted by it4.kp (had 251 views)
Yes. Your best option would be to create a DataRow style that handles the event and the set the ItemContainerStyle property to that style.
Imported from legacy forums. Posted by Jenny [Xceed] (had 3699 views)