Today I tried to put a context menu on a row in a RadGridView that would operate on the row clicked. I was surprised to find it was not nearly as trivial as I expected. All the documentation on this is either very old or accomplishing it via code or code-behind. The "official" demo even has an entry for "Row Context Menu", which sounds tantalizingly close until one looks at the code. It's certainly not MVVM!
This should be as simple as the following:
<telerik:RadGridView ItemsSource="{Binding Path=MyRecords}">
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu >
<telerik:RadMenuItem Header="Do something to this record" Command="{Binding MyRowCommand}" CommandParameter="{Binding ?????}" />
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
...
</telerik:RadGridView>
The problem is that I can't for the life of me figure out what to pass as the command parameter that will help me identify the row.
Any help would be much appreciated!