We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Controlling the visiblity of a TreeViewItemAdv

I have my data databound to a TreeViewItemAdv. I would like to control the visiblity of the tree node for filtering purposes. How do I do this via databinding?

Anton

3 Replies

MM Michael Matela September 25, 2009 06:54 AM UTC

If you have a Model-View-ViewModel approach (see http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx for why this is best):

1) Have a property IsVisible on the ViewModel.
2) Bind the property to the TreeViewItemAdv:





Kind regards,
Daniel Rose
EXAPT Systemtechnik GmbH


AD Anton De Gruchy September 25, 2009 12:35 PM UTC

Thanks,

I used the following XAML





but I get the following error.

Error 1 The Property Setter 'IsVisible' cannot be set because it does not have an accessible set accessor. Line 57 Position 29.


VM Venugopal M Syncfusion Team September 25, 2009 02:11 PM UTC

Hi Anton,

Yes. IsVisible is read-only property. You can use Visibility Property with BooleanToVisibilityConverter converter.

For instance,








Hope this will solve your problem.

Thanks for your interest in Syncfusion products.

Thanks,
Venugopal.

Loader.
Live Chat Icon For mobile
Up arrow icon