Hi All,
I have a WebDataTree that displays Active and Inactive company names with contact details as child nodes. There are three levels as below:
Active
Company Name
Contact One
Contact Two
Company name and contact details are manually added to the tree in code behind using:
//Add company name to the tree
webDataTree.Nodes(EntityStatus.Active).Nodes.Add(item.CompanyName, item.CompanyId)
// Add contact details to the company node
webDataTree.Nodes(status).Nodes.FindNodeByKey(currentCompanyId).Nodes.Add(contactNode)
This was working fine until recently when we came across a company with more than 3000 contacts. Now, the method that loads the tree runs fine, but the tree still takes a long time to load. When selecting any contact node from the tree to display details of the contact, it brings up an IE error that the script is taking too long to run.
The Infragistics version number is 10.1.20101.1011.
I would appreciate your assistance with this query.
Thanks.
There was no specific reason for choosing 7000 it is to make sure enough that i covered all my nodes. i believe it correlates to the total number of tree nodes which are cahced at the tree view state , what the view state actually does is it serializes these objects and flushes the xml with the page html renedered in a hidden field right, so when you apply post back the server Deserializer object attempts to deserialize these objects one more time to map it to DateTreeNode objects hitting threshold constraint and firing the nasty exception
By initially disabling the view state no objects were serialized hence DataTreeNodes to serialize = 0 that explains why the exception wasn't fired when we disabled the control View State but most of the cases we need to maintain the control view state for tracking checked/unchecked nodes
Sam
Thanks Sameh. I will try this shortly.
Was there a specific reason you chose 7000 as the value? Does it correlate to the number of nodes or number of child nodes etc?
Hi
Forget about disabling the view state, disabling view state actually lead me to the real cause of the issue, it is all about the object deserializer, the object map size in memory has to be altered ie number of objects to be deserialized.
i already updated my reply you need to override the web configuration file by adding new app setting entry
<
add key="aspnet:MaxJsonDeserializerMembers" value="7000" />
Hi Sameh,
Were you able to get this working by disabling viewstate? Do you have any sample code to do this? I am encountering a couple of issues as listed in my reply above.
Appreciate your help.
Hi Tsvetelina,
I am just looking at this now. Could you please assist with these two questions:
1. When I disable viewstate, I lose the tree data after a node is selected. I was able to fix this by re-binding my data on Page_Init. Is this correct?
2. When I disable viewstate, the uxWebDataTree.NodePopulate event handler loses the event arguments. As a result, I am unable to retrieve the key of the node that has been clicked. I tried a couple of options like setting hidden variables in node click client side event etc.
What would your suggestion be to implement this functionlity after setting the EnableViewState to false?