<Inf:XamDataGrid x:Name="AnnotationsView"
DataSource="{Binding AnnotationResults, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsSynchronizedWithCurrentItem ="True"
GroupByAreaLocation="None"
AutoFit="true"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
VerticalAlignment="Stretch"
>
<Inf:XamDataGrid.InputBindings>
<MouseBinding MouseAction="LeftClick" Command="{Binding Path=UpdateChartsCommand, Mode=OneWay}" CommandParameter="{Binding ElementName=AnnotationsView, Path=ActiveDataItem}"></MouseBinding>
</Inf:XamDataGrid.InputBindings>
<Inf:XamDataGrid.FieldSettings> <Inf:FieldSettings AllowEdit="False" LabelClickAction="SortByMultipleFields" AllowRecordFiltering="True" AllowFixing="No" LabelTextWrapping="Wrap" CellClickAction="SelectRecord" />
The parameter is null though the path is set to ActiveDataItem. I get the parameter though if I change MouseAction to LeftDoubleClick. How can I get it to pass the parameter when Left clicked on a row? Appreciate all help.
Hello Lalasa,
Thank you for your post. I have been looking into it and I can say that this behavior is expected, because when you use the Mouse’s LeftClick action you override the XamDataGrid command that selects / activates the Record, so I believe your option is to use LeftDoubleClick, because the XamDataGrid doesn’t have a command bound to this action.
Hope this helps you.
Thank you. Left Double click is not an intuitive action for my user. I can achieve the update on left click functionality using the event handler method setting the property SelectedRowsCollectionChanged="OnRowSelected". It just bothers me that I cant do it using commands the MVVM way and have to stick to the event handlers to achieve the behavior I am looking for. Very frustrating indeed.
Thank you for your feedback. As I said this is by design and the command is already used by the XamDataGrid.