Hi,
I have a context menu on my XamGrid. I need to get the underlying rows datacontext when I click on a context menu item. For that I guess I would first need to set the row as selected on right clicking on a row. How do I achieve this? Please note that I'm asking for a solution for XamGrid and not XamDataGrid.
Thanks.
Ganesh
Hello Ganesh,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Hi Stefan, I am also having trouble to do the right click on XAMGRID, not XAMDATAGRID.
My view is:
<ig:XamGrid
Name="xamRaceDetails" Margin="5,0,0,0" Grid.Row="3" ActiveItem="{Binding SelectedDec, Mode=TwoWay}" ItemsSource="{Binding Decisions}" AutoGenerateColumns="False" Grid.Column="0" Grid.ColumnSpan="5" >
and here is some ContextMenu
<ig:XamGrid.ContextMenu > <ContextMenu > <MenuItem Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}, Path=DataContext.SaveFavoriteCommand}" Header="Save As Favorite Race" /> <MenuItem Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}, Path=DataContext.RemoveFavoriteCommand}" Header="Remove Favorite Race" /> </ContextMenu> </ig:XamGrid.ContextMenu>
I want to make the right click--> choose from the ContextMenu and fire the command. Right now it seems I have to LEFT click it first and then right click to pass in database, otherwise simply RIGHT click on cell will not make the ActiveItem change.
this has confused me for two days and there are very limited posts related to XAMGRID. Please attach a simple solution if possible.
Thanks,
David