Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
920
select grid item on left click and pass it to the command as paramter
posted

<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.

Parents
No Data
Reply
  • 138253
    Offline posted

    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.

Children