This is a migrated thread and some comments may be shown as answers.

Row Double Click - MVVM

4 Answers 198 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 07 Mar 2012, 11:27 PM
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.

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 08 Mar 2012, 01:57 PM
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 >>
0
Rayne
Top achievements
Rank 1
answered on 08 Mar 2012, 03:44 PM
That seems to be working well. Thanks.
0
Maheshraj
Top achievements
Rank 1
answered on 20 Jul 2012, 12:14 PM
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
0
Francis
Top achievements
Rank 1
answered on 20 Jul 2012, 01:30 PM
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.
Tags
GridView
Asked by
Rayne
Top achievements
Rank 1
Answers by
Maya
Telerik team
Rayne
Top achievements
Rank 1
Maheshraj
Top achievements
Rank 1
Francis
Top achievements
Rank 1
Share this question
or