This is a migrated thread and some comments may be shown as answers.

[Solved] Setting node.Visible = false doesn't appear to work

1 Answer 13 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 07 Nov 2011, 10:21 PM
Hello, 

I'm trying to construct a tree view and set some nodes as Visible = false when they meet a set of requirements.  Unfortunately, when constructing the tree view data structure in my controller, the nodes are still rendered on the client.  

I'm using the bindTo method on the tree to bind the JSON result to the tree.  It doesn't appear the Visible property is even being passed to the page when looking at the Fiddler response.  

Am I doing something wrong?  Is setting a node Visible=false not supported?  

Thanks, 
Dave

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 10 Nov 2011, 11:36 AM
Hello David,

This functionality is currently unsupported -- only the properties exposed in the TreeViewItemModel class are serialized. We have logged your request and will consider implementing it for a future release. Right now, you can work-around that by creating a custom TreeViewItem object that serializes the Visible attribute (or remove the [ScriptIgnore] in the NavigationItem code), and filtering the hidden nodes out before passing the JSON to bindTo.

Greetings,
Alex Gyoshev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
TreeView
Asked by
David
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or