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
 
Back
Top