Row Double Click - MVVM

5 posts, 0 answers
  1. Rayne
    Rayne avatar
    261 posts
    Member since:
    Sep 2010

    Posted 07 Mar 2012 Link to this post

    My view and viewmodel don't know anything about each other. I need a way to do a mouse double click on a gridview row using MVVM with no code behind. I'm using Caliburn Micro to marry the view and viewmodel, so I can take advantage of CM Actions to get it done. I just don't know how.

    I'm new to Silverlight coming over from WPF and struggling a bit on how to get things accomplished.
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 08 Mar 2012 Link to this post

    Hi Rayne,

    You can try creating an event trigger and work with RowActivated event of RadGridView. Generally, RowActivated event will be triggered once you double click on a row or execute RowActivated command. 
    Will that approach correspond to your requirements ? 

    Regards,
    Maya
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. Rayne
    Rayne avatar
    261 posts
    Member since:
    Sep 2010

    Posted 08 Mar 2012 Link to this post

    That seems to be working well. Thanks.
  4. Maheshraj
    Maheshraj avatar
    1 posts
    Member since:
    May 2012

    Posted 20 Jul 2012 Link to this post

    Hi,
    The RowActivated event works fine when I double click the RadGridView. This event fires even, when I double click my Headers . So what I want is to stop this event firing on Header double click. Else do we have any other event to fire only when the user double click the Row or items inside the RadGridview.
    Note : I am using MVVM pattern.

    Thanks,
    Mahesh
  5. Francis
    Francis avatar
    15 posts
    Member since:
    Apr 2011

    Posted 20 Jul 2012 Link to this post

    Hi Maya,

    This is slightly different but I just need help to get it sorted, and am running late on a release.

    I am using a RadGridView to display measurement values, in an MVVM setup. I bind the grid to an observable collection. Users have an option of displaying the values in either metric or imperial units (default values are in metric units) by checking a checkbox - when checkbox value changes to true, a method in my viewmodel is called that iterates through all the items in the observable collection and converts the units to imperial (inches and pounds) and the radgrid displays the imperial units okay. When the user wants to edit an item in the grid, they double click the item and a popup window shows allowing them to edit. This is where my problem is, if the user changes  to imperial units and double clicks an item to edit, all the values on the radgrid revert back to the original values (metric units). What should I do to avoid this? Or is it the behavior of the radgrid by default? I am using radcontrols for silverlight 5, C# and MVVM. Please help resolve this as I am delaying arelease for my clients.


    NOTE: Stepping through my code I can see that the observable collection has only the imperial values, but radgrid will show original/metric values.


    Thank you, for any and all the help in advance.


    Francis.
Back to Top