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
120
How do i bind to IsActive on CellValuePresenter
posted

Hi , 

im working with MVVM pattern and i have object with fields and on each field i have a property IsSelected.

so if i want in code to highlight a spesific cell i go to the data and mark the field IsSelected=true

but i cant get it to work

<Style x:Key="DefaultCell" TargetType="{x:Type igDP:CellValuePresenter}" >
            <Setter Property="BorderThickness" Value="0.5"/>
            <Setter Property="IsActive" Value="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Value.IsSelected,Mode=TwoWay}"/>
</Style>

is there another way i can achive my goal ?
** Highlight a spesific cell from code with MVVM **

Parents
No Data
Reply
  • 120
    Verified Answer
    posted

    Got it ! 

    <Setter Property="IsActive" Value="{Binding Path=Value.IsSelected, RelativeSource={RelativeSource Self}, Mode=TwoWay}"/>
    

Children
No Data