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
205
bind property to IsExpanded of XamGridTree in TwoWay
posted

hi

in my model property with this name "IsOpen" exist

how to bind this property to IsExpanded of xamTreeGrid.

and when tree is open this property set true else set false

this is my code mut not work

<igi:XamTreeGrid DataContext="{Binding Items}" DataSource="{Binding}" x:Name="xamTreeGrid" >
<igi:XamTreeGrid.Resources>
<Style TargetType="{x:Type igi:TreeCellValuePresenter}" >
<Setter Property="IsExpanded" Value="{Binding IsOpen,Mode=TwoWay}"/>
</Style>
</igi:XamTreeGrid.Resources>
</igi:xamTreeGrid>

Parents
No Data
Reply
  • 34510
    Offline posted

    Hi Behzad,

    Try adding the text "DataItem" right before your IsOpen property.

    "{Binding DataItem.IsOpen, Mode=TwoWay}"

    The DataContext for a TreeCellValuePresenter is a DataRecord and inside DataRecord there is a DataItem property.  This DataItem is your underlying data object.

Children