Home - Forums-.NET - FlyTreeView (ASP.NET) - Are ImageUrl and checked status kept in ViewState

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Are ImageUrl and checked status kept in ViewState
Link Posted: 18-Nov-2005 10:54
Hello,

     I am having a problem maintaing state of the checked status of TreeNode objects contained in the Nodes collection of the FlyTreeView control, as well as maintaing the state of the ImageUrl and ExpandedImageUrl properties of these TreeNodes.  These properties are set dynamically in javascript i.e. if someone checks a folder, these properties are all changed.  After posting back to the server, these values resort back to their initial setting.  What is strange is that other properties of a TreeNode object i.e. whether it is expanded or not, are retained with postbacks.  I am certain that ViewState is enabled for the FTV control.
     Shouldn't the state of these properties be maintained in the ViewState of the FTV control automatically without any additional implementation?

Thanks.

sbyam
Link Posted: 20-Nov-2005 01:50
Actually these properties are persited between postbacks, but setting them at client-side does not affects server-side nodes structures, what Expanded property does.  And from my point of view the only way for you is to add a custom data with new image urls to client-side node.Data property when you're chaning these properties and hanlde these changes when the page is posted back.