Home Forums WPF controls Xceed DataGrid for WPF How to select row?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24257 |

    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)

    Xceed Support
    Member
    Post count: 5658

    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)

    User (Old forums)
    Member
    Post count: 23064

    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)

    Xceed Support
    Member
    Post count: 5658

    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)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.