wpf - how to handle DataGrid event in ViewModel class -


i trying handle datagrid event in viewmodel class. since there no command property in datagrid becomes tough handle events in datagrid. refered interaction.triggers ,but system.windows.interactivity.dll giving exception while building project. please me.

here 1 example in projects. use mvvm light version eventtocommand, system.windows.interactivity.dll should work too

  <datagrid itemssource="{binding myview}" autogeneratecolumns="false"               x:name="myprotokolllist"               isreadonly="true"                canuseraddrows="false" canuserdeleterows="false" canuserreordercolumns="true"               selectionmode="extended" selectionunit="fullrow"               selecteditem="{binding selectedrow, mode=oneway}"               issynchronizedwithcurrentitem="true">         <i:interaction.triggers>             <i:eventtrigger eventname="mousedoubleclick">                 <commanding:eventtocommand  command="{binding path=opencommand}"                                              commandparameter="{binding elementname=myprotokolllist, path=selecteditem}"/>             </i:eventtrigger>         </i:interaction.triggers> 

Comments

Popular posts from this blog

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

rest - Spring boot: Request method 'PUT' not supported -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -