DataGrid issue

  • Thread starter Thread starter Sebastian@IG&A::
  • Start date Start date
S

Sebastian@IG&A::

Hi all, quick question.
I have a DataGrid with a ContextMenu, the thing is that I want the
context menu to execute some code depending on the row I opened the
context menu from. And that's not always the CurrentRowIndex.

How can I change the CurrentRowIndex to the row I poped up the menu
from.

Did I make myself clear?

TIA.
Sebastián
 
you determine the actual row clicked by creating an event
handler for the datagrid click event and then you use the
HitTestInformation on the eventargs to determine if the click
was on a cell, determine the row of that cell, and then display the
correct context menu for that row.
--
Darren Shaffer
..NET Compact Framework MVP
Principal Architect
Connected Innovation
www.connectedinnovation.com

Hi all, quick question.
I have a DataGrid with a ContextMenu, the thing is that I want the
context menu to execute some code depending on the row I opened the
context menu from. And that's not always the CurrentRowIndex.

How can I change the CurrentRowIndex to the row I poped up the menu
from.

Did I make myself clear?

TIA.
Sebastián
 
Back
Top