My page builds the tree in code. It adds four top level items. Each of those
gets 10 children, and each of those children gets 20 children. (So there are
844 individual nodes).
The code itself runs very quickly. It is just the rendering of the treeview
to the browser that seems to be the problem.
I've done a few tests whch, pretty much, convince me that it is not the code
that I use to build the tree.
If I remove the treeview from the page's controls collection, the page loads
very quickly, but, of course, nothing ever gets displayed.
If I replace the treeview with a menu object, I can use almost identical
code to build the menu, which displays very quickly.
Does anyone have any suggestions?
This did not really help IE, and if anything, it slowed down Firefox (but
that might just be my imagination).
I've made some more changes, which are a bit more hopeful.
In the post above, where I said that I was using populateondemand, I was
probably doing it in a silly way (but in my defence, I was just following the
steps outlined in some tutorial).
Basically, I had three functions : populateTopLevelNodes,
populateChildNodes, populateGrandChildNodes.
On load, I ran populateTopLevelNodes. Then in the TreeView1_TreeNodePopulate
event handler, I populated everything else. So, I would check the type of
node, and populate it accordingly (using populateChildNodes or
populateGrandChildNodes).
As I mentioned, this was not particularly useful.
I changed things so that the populateChildNodes and populateGrandChildNodes
now get called from the TreeView1_SelectedNodeChanged event handler. This is
a bit faster, although I am getting some errors when I click on the child
nodes.
My problem with this is that it complicates my code and just seems
unnecessary.
I'd still like to know if someone has a better solution.
Thanks,
Doug
If I plop the treeview into a table, IE slows down. If I remove it from the
table, IE speeds up.
Its still not as fast as Firefox, but I think I can make this work well
enough now.
thanks,
Doug
"WayneB" wrote:
> Hi
>
> I've been having the same problem. IE very slow, Opera and Firefox pretty
> quick. I don't think it's your code.
>
> I was placing my treeview in a table. If I remove the table and replace with
> a <div> it works just as quickly as Opera and Firefox. Let me know if this
> works for you.
>
> Cheers
>
> Wayne
It actually looks like the tree isstill as slow as ever, only when it is not
contained within a table we actually get the pleasure of watching it get
built. (When it is within a table, that outer table does not get rendered
until the contents - the treeview itself - are rendered, s it seems slower.)
This would actually be ok, except that mousing over the treeview while it is
being built causes javascript errors. (Once again, this is with IE only.)
I've tried to disable the treeview until it is fully built, but that does
not seem to work.
Anyone have any ideas here?
Doug
I wish I could offer some help, but I'm experiencing the exact same problem
as yourself. If I display the data that builds the tree in a
'Response.Write' way, the data is displayed in less than a second. Build a
treeview with it, and it takes over 30 seconds! We're trying to convert a
desktop system to a web app, and it seems that it just can't be done if
you're dealing with too much data. Seems a shame because I thought that was
the whole point!
If I uncover any ground breaking discoveries, I'll let you know, but I've
now given up with it. Looks like desktop power is here to stay!
Regards,
Mike
Thanks for sharing the pain. :)
Doug