Hi,
I am trying to load about 7500 nodes using the NodeSrc function and Expand Levels. This is working very well with one exception: -
It is very hit or miss as to whether the dynamically loaded nodes will have expand button even if the node should have. Sometimes a node will not have an expand button but on refresh it will.
I have stepped through my code and made sure that the NodeSrc is being added and it is so I am at a loss as to why this is happening.
I really want to use this control but cannot live with it if it will not give consistent results.
Any help would be great here is my code.
foreach(DataRow dr in ds.Tables[0].Rows)
{
TreeNode tn = new TreeNode();
tn.Text = Server.HtmlEncode(dr[\"Text\"].ToString());
tn.ToolTip = Server.HtmlEncode(dr[\"Text\"].ToString());
tn.Key = Server.HtmlEncode(dr[\"ID\"].ToString());
try
{
// if folder does not have own children then do not show its NodeSrc
if (dr[\"HasChildren\"].ToString() != \"0\")
tn.NodeSrc = \"GetRoleNodes.aspx?ParentID=\" + Server.UrlEncode(dr[\"ID\"].ToString());
else
System.Diagnostics.Debug.WriteLine(dr[\"ID\"].ToString());
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(dr[\"ID\"].ToString());
AddExceptionNode(tn.Nodes, ex);
}
// adding node to FlyNodeSet
RoleNodes.Nodes.Add(tn);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ParentID);
AddExceptionNode(RoleNodes.Nodes, ex);
}
}
Thanks in advance
Oliver