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.
Unfortunately, activation email could not send to your email. Please try again.

Controlling the visiblity of a TreeViewItemAdv

Thread ID:

Created:

Updated:

Platform:

Replies:

90305 Sep 24,2009 09:22 AM Sep 25,2009 10:11 AM WPF 3
loading
Tags: Tools
Anton De Gruchy
Asked On September 24, 2009 09:22 AM

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

Michael Matela
Replied On September 25, 2009 02:54 AM

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

Anton De Gruchy
Replied On September 25, 2009 08:35 AM

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.

Venugopal M [Syncfusion]
Replied On September 25, 2009 10:11 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;