in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

treeList Performance

Last post 11/4/2008 11:31 AM by Corun Johnson. 1 replies.
Page 1 of 1 (2 items)
Sort Posts:
Previous Next
  • 11/4/2008 6:44 AM

    treeList Performance

     Hi,

    I'm having some performance issues with the treeList control. I am populating it in virtual mode using the following events:

     

            protected void treeList_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e)

            {

                Explorer explorer = (Explorer)e.NodeObject;

                int? id = explorer == null ? (int?) null : explorer.ID;

                e.Children = BGI.ExplorerData.Get(id);

            }

     

            protected void treeList_VirtualModeNodeCreating(object sender, TreeListVirtualModeNodeCreatingEventArgs e)

            {

                Explorer explorer = (Explorer)e.NodeObject;

                e.NodeKeyValue = explorer.ID;

                e.IsLeaf = explorer.IsLeaf;

                e.SetNodeValue("node", explorer.Node);

                e.SetNodeValue("dtd_tot_base", explorer.Daily);

                e.SetNodeValue("mtd_tot_base", explorer.MTD);

                e.SetNodeValue("ytd_tot_base", explorer.YTD);

            }

     

    Explorer is just a class which is used to contain a single item of data.

    ExplorerData.Get is a static method which queries the database and retrieves a sqlDataReader and then populates it into a List of Explorer classes.

    I've noticed that treeList_VirtualModeCreateChildren gets called for every opened node in the control. This does not seem right to me as I would expect it to just query the latest. Am I doing something wrong here? It does not seem right that it would have to build the entire tree each time and not just the new bits?

    Any help would be greatfully received. Or indeed any other advice for improving performance.

    Thanks in advance

    Corun

    Filed under:
  • 11/4/2008 11:31 AM In reply to

    Re: treeList Performance

     Actually please disregard this.

    I used standard data binding instead. 

    Because I had 10,000 rows i was worried about perofmance (hence why i was trying to di it in virtual mode), but the performance was good.

Page 1 of 1 (2 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED