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
2815
Binding to CellValuePresenter.IsSelected
posted

When a record is selected within the xamDataGrid, I want a property named IsSelected on the underlying data item to be set to true.   My xamDataGrid has the following resources defined:

 

      <igDP:XamDataGrid.Resources>
                    <Style TargetType="{x:Type igDP:RecordPresenter}" >
                        <Setter Property="IsSelected" Value="{Binding Path=(igDP:DataRecord.DataItem).IsSelected}"/>                       
                    </Style>

                   
                    <Style TargetType="{x:Type igDP:CellValuePresenter}" >
                        <Setter Property="HorizontalContentAlignment" Value="Left"/>
                        <Setter Property="BorderBrush" Value="{StaticResource DataGridCellOuterBorder}" />
                        <Setter Property="BorderThickness" Value="1,0,0, 0" />
                        <Setter Property="Padding" Value="5,0,0, 0" />
                        <Setter Property="FontWeight" Value="Bold" />                       
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Path=(igDP:DataRecord.DataItem).Status}" Value="Acknowledged">
                                <Setter Property="FontWeight" Value="Normal" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </igDP:XamDataGrid.Resources>

When I select a record, my data item's IsSelected property is not being set to true.

What am I missing?

TIA,

 

Klaus

 

 

Parents
  • 20
    Offline posted

    Hi, Did you tried

     

     

     

     

     

     

    <Style TargetType="{x:Type igDP:DataRecordCellArea}" BasedOn="{StaticResource DataRecordCellAreaStyle

    }">

     

     

     

    <!-- To bind selection property to ViewModel Item !!!! -->

     

     

     

    <Setter Property="IsSelected" Value="{Binding DataItem.IsSelected, Mode

    =TwoWay}"/>

     

     

     

    </Style

    >

     

Reply Children
No Data