Skip Navigation LinksHome / Community & Support / Code Library / WPF > General and Integration Projects > MVVM Context & Row doubleclick functionality

Not answered MVVM Context & Row doubleclick functionality

Feed from this thread
  • k f avatar

    Posted on Apr 6, 2010 (permalink)

    Requirements

    RadControls version

    Q1 2010        

    .NET version

    .Net 3.5    

    Visual Studio version

    2008

    programming language

    C#

    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION
    The attached code demonstrates how to create a MVVM app with a RadGridView with right click Context Menu functionality as well as the ability to double click a row and have it fire a command in the ViewModel.

    A full write up of this using Prism as well as MVVM will be listed at http://www.compositedevpatterns.com Go to the Training (Prism) category, Lesson 9.

    In short, there is an assembly named WPFMVVMPrism which is based of the Cinch Framework but also includes some other code.

    This demonstrates how you can right click on a row and display a Contextmenu and select a menuItem and have it pass the CurrentItem back to the ViewModel.

    Also, it allows you to double click a row and have the row Item passed back to your viewModel.

    Attached files

  • k f avatar

    Posted on Apr 9, 2010 (permalink)

    Updated the sample to use the PreviewMouseRightClickDown event.  Also, I was advised that the IsSelected command will be deprecated so fixed the code in this version.
    Attached files

  • Anderson avatar

    Posted on Aug 18, 2010 (permalink)

    I'm having a little trouble with the double-click functionality.  I'd like to limit it to when the user just double-clicks a row and not anywhere in the grid, like you have here.  As an example, click to select a row, and then try double-clicking on a column header.

    Edit:
    Nevermind. I found this in another one of your posts:

    private void RGV_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
    {
        e.Handled = ((FrameworkElement)e.OriginalSource).ParentOfType<GridViewRow>() == null;
    }

Back to Top

Skip Navigation LinksHome / Community & Support / Code Library / WPF > General and Integration Projects > MVVM Context & Row doubleclick functionality