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
2349
How do I capture when a row is double clicked?
posted

Seems pretty simple, but I can't find anything in the documentation or in these forums.  Can someone please help?

Parents
No Data
Reply
  • 1531
    posted

    We do this a lot in our apps.  Basically add something like this to your window constructor:

    DataGrid.MouseDoubleClick +=  new MouseButtonEventHandler(DataGridOnMouseDoubleClick);

    Replace "DataGrid" with the name of your XamDataGrid.

    Then, you just need to write the event handler with something like this:

     

    private void DataGridOnMouseDoubleClick(Object sender, RoutedEventArgs e)

    {

       

    DataRecord activeRecord = (DataGrid.ActiveRecord as DataRecord);

     

        if ((activeRecord != null) && (!activeRecord.IsAddRecord))

        {

     

    ....some stuff here with activeRecord

        }

    }

Children