Skip to content

Infragistics Community Forum / General / Selected row on right click context menu – XamDataGrid

Selected row on right click context menu – XamDataGrid

New Discussion
Uma Mageswari
Uma Mageswari asked on Nov 26, 2021 11:31 AM

Hi,

I have a context menu on my XamDataGrid. I need to get the underlying row when I click on a context menu item for a selected row. For that I guess I would first need to set the row as selected on right clicking on a row. How do I achieve this?

SelectedDataItem of XamDataGrid does not have the values of the row selected. Any help on this pls

Thanks,

Uma

Sign In to post a reply

Replies

  • 0
    Ivan Kitanov
    Ivan Kitanov answered on Nov 26, 2021 11:31 AM

    Hello Uma,

    It’s not necessary to select the row that the content menu has been opened on to access the row of the XamDataGrid and apply some custom logic on it. In fact, a custom command could be used for the MenuItems of the ContextMenu, when the ContextMenu is set only for the rows of the XamDataGrid by applying the menu to the DataRecordCellArea. In the Execute method the command, the method parameter should be cast to DataRecordCellArea, from which the record could be obtained with the Record property. After the record is obtained you can apply any custom logic that fits the needs of your application.

    I am attaching a small sample application that demonstrates what I have explained above.

    Please test this sample on your side and let me know if you have any questions.

    Regards,
    Ivan Kitanov

    AccessRowFromContextMenuItem

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Uma Mageswari
Favorites
0
Replies
1
Created On
Nov 26, 2021
Last Post
4 years, 3 months ago

Suggested Discussions

Created by

Created on

Nov 26, 2021 11:31 AM

Last activity on

Feb 23, 2026 1:51 PM