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.
Hello rzwirtz,
I'm glad I could help. If you have any further questions please do not hesitate to ask.
That worked perfect. Thanks for the help.
I suggest that you try using WebDataTree’s manual load on demand to dynamically create nodes, depending on the object type you bind them to. Demonstrative sample of this feature can be found here - http://samples.infragistics.com/aspnet/Samples/WebDataTree/Performance/ManualLoadOnDemand/Default.aspx?cn=data-tree&sid=c257cd9c-1c5a-4159-aa51-ff8ea8386395.
If you have any other questions please feel free to contact me.
That works, however the node being bound at all is causing a performance issue. The way my object is written it does not load the collection of objects unless it you ask for them. Because of that doing any loading at all put performance strain on my application. The collection is a collection of documents associated with the web page object. They can be quite large, so loading them from the database when I don't even need to display them is somewhat silly. Is there any way to only have the tree bind objects of a certain type?
I have been reading through your post and I can suggest that you check the DataMember property of each node in NodeBound event handler. If it is different from your page object’s class, you could set it’s Visible property to false.
protected void WebDataTree1_NodeBound(object sender, DataTreeNodeEventArgs e)
{
object dataItem;
dataItem = e.Node.DataItem;
if ( dataItem.GetType().ToString() != "MyPage")
e.Node.Visible = false;
//Shows the node's parent as empty
e.Node.ParentNode.IsEmptyParent = false;
}
Please let me know if this helps.