Grid Context Menu

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Recently I was given a solution to a similar problem with a ListBox, but now
I need to do the same thing with a DataGrid.

I want my users to be able to right click on a row on a DataGrid and not
only get the context menu, but have the selection move to the row they've
right clicked.

Is there any way to do this?

Art
 
Hello,

You might want to try this: Use DataGrid.HitTest() in the mouseup event of
the grid to get the row number of the row right-clicked. Then pass it to
DataGrid.Select() to select that row.

HTH?

Hi,

Recently I was given a solution to a similar problem with a ListBox, but now
I need to do the same thing with a DataGrid.

I want my users to be able to right click on a row on a DataGrid and not
only get the context menu, but have the selection move to the row they've
right clicked.

Is there any way to do this?

Art
 

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

Back
Top