Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
Performance in UltraTree Outlook Mode
posted

I have an application which uses an UltraTree in Outlook mode which has worked well over the years however i am hitting some performance issues which I am trying to get to the bottom of.

It Outlook mode it appears that I have to add node using the parentNode.Add() method to get the column set created correctly for the new node which I do and then set a number fof attributes for the node (cell values etc).  I have traced the code and added timers to find what seems to be taking the time and have narrowed it down to a single line which sets

node.Override.ShowExpansionIndicator = ShowExpansionIndicator.CheckOnExpand;

For about 16K nodes this one line increases the time to display the tree from 6 seconds to over 20 seconds yet to me it shouldn't actually cause anything to happen?  I have the source code for the UltraTree but cannot see what is happening when this flag is set - does it trigger other events?  I have begin / End Update around the entire operation but that doesn't help.

I was hooping I could set the flag for the parent node and have it filter down but that doesn't work either.  Any suggestions most welcome.

I also find it odd that there does not appear to be a way to add a range of nodes in one go when working in Outlook mode - well you can but there doesn't appear to be a way to create all of the nodes, set their cell values and tags and then add to the parent node as the column set is not set for the new node until it is added to the parent (as far as I can tell).

Parents
  • 469350
    Offline posted

    May I ask why you are using ShowExpansionIndicator.CheckOnExpand
    The purpose of this setting is to optimize the loading of the tree when using DataBinding. But it sounds like you are manually adding the nodes to your tree using node.Nodes.Add(). 

    The point of CheckOnExpand is that it allows all nodes in the tree to show an expansion indication and then the tree doesn't actually check to see if there are child nodes until the user or something else expands the node. That way, the tree doesn't have to access the data data source to determine if that node has any child nodes, which can be an expensive process. As opposed to CheckOnDisplay, which would have to force all nodes to load their child nodes in order to determine whether the expansion indicator is needed whenever that node is displayed on-screen, even before the user expands it. 

    So ShowExpansionIndicator.CheckOnExpand doesn't really make a lot of sense for an unbound tree, since there's no data source to access and the node already knows if it has child nodes instantly, since that information is right in memory. 

    If CheckOnExand is somehow slowing things down, then I agree that sounds like a problem, and maybe a bug. But using that setting for an unbound tree doesn't make sense, anyway, so I'm not sure it's worth pursuing. Unless I am missing something. :) 


    EDIT: Oh... there is one other reason to use ShowExpansionIndicator.CheckOnExpand. If you are not populating all of the tree nodes up-front and you are handling the BeforeExpand event to populate the child nodes as-needed. Are you doing that? 

Reply Children