Datagrid - right click select and context menu

S

skOOb33

I have a context menu for a datagrid that shows up fine. I am wanting
to set it to where when a user right clicks anywhere on the grid, it
will select the row the mouse is over (if it's over one), and then
display the context menu. Any help is appreciated.

thanks
 
C

Chris

skOOb33 said:
I have a context menu for a datagrid that shows up fine. I am wanting
to set it to where when a user right clicks anywhere on the grid, it
will select the row the mouse is over (if it's over one), and then
display the context menu. Any help is appreciated.

thanks

You will need to use the HitTestInfo class to determine if the DataGrid
is over a cell. If it is then you will use the DataGrid.Select command
to select the row you want. Just run those calls before you open your
context menu.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top