I am working with devexpress winform controls and At this moment I have defined the RowDoubleClick event in my view constructor as shown below:
mvvmContext1.WithEvent<MyViewModel, RowClickEventArgs>(gridView1, "RowClick")
.EventToCommand(x => x.Show(),
v => (v.Clicks == 2) && (v.Button == MouseButtons.Left));
The show method in the corresponding viewModel looks like this:
public void Show()
{
messageBoxService.ShowMessage("Row Clicked");
}
When I double click on the row, the messagebox appears and "Row Clicked" is printed, but I want to get the row data (type of student) in this show method too.
How can I do this?
Take a look at Table (CollectionView) demo. I suggest you split your binding into two parts - binding the Focused row to the ViewModel's property. And than, binding of double click action to the
Show
command:ViewModel: