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

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -