I am having an issue where whenever a post back is triggered on my page the Web Data Tree empties out. Even though I'm rebinding the control on post back it still empties every time.
After more research into other problem I think I have found what is causing it. I have a collection of web page objects which are the top level level web pages for my website. Each of them has a collection of there child web pages, and so on and so forth. The issue arises because each one of those web page objects has two other collections on it that do not contain web page objects. I do not want these to display in the tree. If I remove the collections from my object that I do not want to display everything shows fine; it seems odd to have to do that though. My question is, how do I force the tree to only show my web page objects?
Hello rzwirtz,
I am glad that you were able to make progress. About the nodes’ text – If you are binding the tree to a data source I suggest that you set the DataBindings, for example:
<DataBindings>
<ig:DataTreeNodeBinding DataMember="Customer" ValueField="CustomerID" TextField="CustomerName" />
<ig:DataTreeNodeBinding DataMember="Order" ValueField="OrderID" TextField="OrderID" />
<ig:DataTreeNodeBinding DataMember="OrderDetail" ValueField="ProductID" TextField="ProductName" />
</DataBindings>
If not you could set the Text property of the nodes serverside or using javascript :
var tree = $find("WebDataTree1");
tree.getNodes(0).getNode(0).set_text("Node text");
If after binding to your data source the nodes are not showing the actual values, please ensure that your tree's data bindings are set. Samples of data binding can be found here - http://samples.infragistics.com/aspnet/Samples/WebDataTree/Data/DataBinding/Default.aspx?cn=data-tree&sid=008acd5c-8589-419d-a37f-c454f52ad737.
Please let me know if this helps.
I am having an issue now where certain objects in the tree are not having there text set properly. Their text is defaulting to the name of the object instead of the "Description" property on the object.. Do you know of anything that could cause that issue?
I was able to fix the issue. What happened was I created custom control in the appcode named "NodeWebDataTree" that inherited from the infragistics web data tree. This control was bound to a collection of my own Node objects(Which are entirely different than infragistics node objects). In the init of this control I was loading up a set of nodes from a database and setting it as the data source. What I figured out is that if you set the datasource and databind in the init event it only works during the first load. If I move the setting of the datasource to the DataBinding event it on subsequent post backs.
Hi rzwirtz,
Thank you for posting in the community.
I wasn’t able to replicate the behavior you are describing. Please check the sample I created. In order to investigate this issue further, I will need to take a look at your code or a sample project, demonstrating this behavior.
Please feel free to contact me if you have any questions.