Hi – I have a TreeView that contains TreeViewItems for different filtering areas. It’s in a User Control that can be used by several charts. I want to control which TreeViewItems are visible or collapsed depending on what the chart needs.
I’ve seen and done examples bound to things like a button or checkbox, but I want this to be behind the scenes, no user interaction needed. My thought is that I set a Boolean in the code-behind and the TreeViewItem is bound to that. Is that possible? If so, how can I do it?
Here is an example of what I have working when a checkbox is selected, so I think my Visibility Converter is working:
<telerik:RadTreeViewItem x:Name="tviWsaSubject" Header="Subject"
ItemsSource="{Binding SubjectLists}"
ItemsOptionListType="CheckList"
ItemTemplate="{StaticResource WsaSubjectTreeViewTemplate}"
Visibility="{Binding Path=IsChecked, ElementName=ckShowSub, Converter={StaticResource visibilityConverter}}"/>
Thank You!