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>
Hi Behzad,
I'm actually not sure why this isn't working for the TreeCellValuePresenter. In the sample it looks like the binding is getting lost for some reason. For now you can change the style to target DataRecordPresenter and it should work. I'm discussing this with our developers to see why TreeCellValuePresenter doesn't work. Will keep you posted.
<Style TargetType="{x:Type ig:DataRecordPresenter}"> <Setter Property="IsExpanded" Value="{Binding DataItem.IsOpen, Mode=TwoWay}"/></Style>
hello again
i upload a sample to show my problem
please help me to solve this problem
thanks for your your help
i create test project and write your code that you tell me but not work i don't know why
i attached test project to you please help me.
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.