Hi,
I need to bind the visibility property of XamDataTree NodeLayout to a property within the items collection. I need to control the visibility of a node dependeing on whether the property is true/false for that item within the collection.
However, the binding does not seem to work. Any help would be highly appreciated.
Thanks
Pallavi
Thanks for the solution Fabien, it works :)
Hello Fabien,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Ok, here's the solution I found :
Add a property in data class MyDataClass :
public bool IsVisible { get; set; }Add ref to igPrimitives at the top of xaml :
xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives"Create a dynamic style :
<UserControl.Resources> <igPrim:BoolToVisibilityConverter x:Key="BoolToVisibility"/> <Style TargetType="{x:Type ig:XamDataTreeNodeControl}" x:Key="NodeStyle"> <Setter Property="Visibility" Value="{Binding Node.Data.IsVisible, Converter={StaticResource BoolToVisibility}}" /> </Style></UserControl.Resources>Add style to every NodeLayout :<ig:NodeLayout TargetTypeName="MyDataClass" DisplayMemberPath="Name" Key="DataNode" NodeStyle="{StaticResource NodeStyle}">...</ig:NodeLayout>Every node checks the property IsVisible of the data an apply it to Visibility :-)
I am requesting sample project, becasue I cannot be completely sure how your Data is organized and where the Property which you want to bind the Layout's Visibility to is defined and to which object it belongs.
Seems prety clear to me, as I have the same problem :
How to bind the Visibility property of a NodeLayout (in a XamDataTree), to a property of the underlying data ?