0

I can't figure this thing out. I have been looking at it for a couple of days now and I must be missing some steps. But this is my objective. I want to double click on a Row of a dataGrid.
I want to take data from that data grid and use it to load a second dataGrid.

I have a view model that contains two ObservableCollections

One is going to load the other. When a user double clicks one, the other should load.

I can figure out how to do that in MVC, but I can't wrap my head around how to accomplish this in MVVM.

IE, not using the View.xmal.cs code behind. I can get the event that way, but I don't want to bastardize my first MVVM project but putting stuff into the code behind.

I am guessing I just don't understand how to do this. Does anybody know of a good tutorial that will show how to do this? Or does anybody have an example application that will let me do this?

000
  • 26,951
  • 10
  • 71
  • 101
SoftwareSavant
  • 9,467
  • 27
  • 121
  • 195
  • At first glance I would say you need to bind the Event trigger to a command and pass parameters to the command to tell it what data you have double clicked on and what not. See this link http://stackoverflow.com/questions/6205472/mvvm-passing-eventargs-as-command-parameter – Bearcat9425 Jun 20 '13 at 20:58

1 Answers1

1

An awesome explanation is posted here on how get datagridrow double click event handled. http://brentedwards.net/2012/03/11/wpf-datagridrow-double-click-with-mvvm/

HichemSeeSharp
  • 3,240
  • 2
  • 22
  • 44