Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
605
XamGrid: Get cell by right mouse click
posted

Hello

how can I get a cell with only a right mouse click without a prior left mouse click?
This has to work for an inactivated cell, no prior activation is done.

Thanks

Parents
No Data
Reply
  • 29105
    Verified Answer
    Offline posted

    Hello Kasar,

    Thank you for reaching out. We recommend handling the XamGrid's PreviewMouseRightButtonDown event and setup a pointer to a CellControl based on the event arguments of the event e.OriginalSource with conjunction of our Utilities class. Let me know if you have any questions.

    eg.



    private void xgrid1_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
           {
               CellControl cell = Utilities.GetAncestorFromType(e.OriginalSource as DependencyObjecttypeof(CellControl), trueas CellControl;
               var value = cell.Cell.Value;
               
           }

Children