DataGrid issue

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
 
D

Darren Shaffer

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
 

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