Ticket T1285515
Visible to All Users

When TreeListControl has up to 300000+ Item, how can I use virtual souce to improve performance?

created 4 days ago

Now I use TreeListControl to show 300,000+ items;

<dxg: TreeListControl x:Name=treeListControl />

and I update data by this way;

// itemList - A List<T> owned 300,000+ T;
treeListControl.ItemSource = itemList;

then, I find out this code will run a long time beyond 6,000 ms;
In fact, I still need to keep these Expanding Status after updating;

// before updating, I use method StoreNodesStatus();
treeListControl.View.RestoreNodesStatus();

God, this code will run a long-long time beyond several minutes.

So, I try some way to improve performance, Maybe Can I use virtual source? but, I don`t know how to implement virtual source to TreeListControl , the demo for GridControl using virtual source does not work on TreeListControl.

Answers approved by DevExpress Support

created 4 days ago

Hello,

TreeListControl/TreeListView needs access to all the items at least at the root level to internally build the hierarchical structure. In the case of the "Selfreference" TreeDerivationMode value, TreeListControl/TreeListView requires access to all the items in the bound plain source. As a result, it cannot work with Virtual Sources or with any source that loads data in small portions.

Currently, TreeListControl/TreeListView offers only two ways to implement asynchronous/dynamic data loading:

  1. Asynchronous Nodes Fetching;
  2. Dynamic Data Loading.

You can try first modifying your source structure to be able to fetch nodes asynchronously and check how it affects the performance in your usage scenario.


In the meantime, I noticed that your current implementation completely resets TreeListControl's ItemsSource collection. This action may be not the best efficient way to update data, especially if you only need to update a limited number of nodes. Would you please describe your usage scenario in greater detail and send us a sample project that demonstrates the actual implementation and performance issues? It may be possible to avoid resetting the ItemsSource property and update only particular nodes without saving and restoring the node states.

Thanks,
Kirill

    Comments (2)

      Thanks for your advice, I think I can Try the two way to avoid Reseting-ItemSource.

        Hello,

        When I try the first way .

        1. Asynchronous Nodes Fetching;

        I find that my source structure is " all item only implement a interface 'IVariableTreeViewItem' ".
        // base interface
        public interface IVariableTreeViewItem
        {
        string ID;
        string ParentID;
        }
        Now, TreeListControl use "KeyFieldName" and "ParentFieldName" to auto-generate children by the same ParentID items, and I dont create children in every item.
        So, I cant implement "ChildNodesSelector" .
        Meanwhile, I m sorry I cant supply the demo for you, because its logic is simple more than Exporting the demo from Private Network.
        Could you advice the other way? Could I only modify my Source Structure?

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.