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.
Hello csggroup,
Thank you for posting in our forums.
Do you take advantage of "Manual Load On Demand" for loading the large number of nodes.
http://samples.infragistics.com/aspnet/Samples/WebDataTree/Performance/ManualLoadOnDemand/Default.aspx?cn=data-tree&sid=c257cd9c-1c5a-4159-aa51-ff8ea8386395
Do you add the nodes one by one?
For example you can use AddRange instead Add for every Node.
Have you used Memory profiler to check which part of the application(method, function, etc) takes long time?
Home hearing from you.
Hi Tsvetelina,
I have spent most of this morning trying out the different options mentioned in your reply and here are my findings. I would appreciate it if you could provide a way forward at the earliest as this could have huge implications on how the control is used in the rest of the application:
2. AddRange - Same results as above
3. Even with the "Manual Load on Demand" code, once a company with thouands of contacts is expanded, selecting a company name to view details, still generates a "IE script error" right before the selected node in the tree is highlighted.
Details of the JSON error mentioned above:
Message
: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
Hi,
Any updates to this? I would appreciate your assistance with regards to this.
Thank you for the update.
Have you tried to increase the max length for json requests in your web.config file
<configuration> <system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="...."> </jsonSerialization> </webServices> </scripting> </system.web.extensions> </configuration>
http://msdn.microsoft.com/en-us/library/bb763183.aspx
I have updated the web.config file maxJsonLength to the maximum integer value based on your reply and here are my findings
1. Manual Load On Demand -
· Initial load of the tree is much quicker
· Expanding a company name with > 3000 contacts - Run-time error as below:
Even with the "Manual Load on Demand" code, once a company with thouands of contacts is expanded, selecting a company name to view details, still generates a "IE script error" right before the selected node in the tree is highlighted.
The IE script error pops up and then redirects to our generic error page due to an unhandled exception. The exception that gets logged is as below:
An exception of type 'System.InvalidOperationException' occurred and was caught.
Type : System.InvalidOperationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : Operation is not valid due to the current state of the object. Source : System.Web.Extensions Help link : Data : System.Collections.ListDictionaryInternal TargetSite : System.Collections.Generic.IDictionary`2[System.String,System.Object] DeserializeDictionary(Int32) Stack Trace : at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeList(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeList(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeList(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input) at Infragistics.Web.UI.Framework.RunBot.HandleOnInit(HttpContext context) at Infragistics.Web.UI.Framework.Data.HierarchicalDataBoundControlMain.OnInit(EventArgs e) at Infragistics.Web.UI.NavigationControls.NavControl.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I would appreciate your assistance with this. Is there a known limitation on the number of nodes that can be added to the WebDataTree control?
I suffer from the same behavior and seems this behavior occurs when the tree nodes exceeds certain number.
I bind to XmlDataSource