473,513 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

populating a treeview with a lot of records

I have a treeview control on a windows form that I want to populate in the form's load event. The problem is that the datatable I am using to populate it contains >20,000 records, and it takes > 1 min to load the form. How can I populate it partially during load and then complete it when the user needs the complete set (i.e. when the user scrolls down)?
Nov 20 '05 #1
8 1808
"Patrick McGuire" <an*******@discussions.microsoft.com> schrieb
I have a treeview control on a windows form that I want to populate
in the form's load event. The problem is that the datatable I am
using to populate it contains >20,000 records, and it takes > 1 min
to load the form. How can I populate it partially during load and
then complete it when the user needs the complete set (i.e. when the
user scrolls down)?


Only populate the first and second level. As soon as the user expands a node
from the first level, load the sub nodes of all sub nodes of the expanded
node.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
A good idea, and I'm already doing that. The situation to which I'm referring, though, is one where there are > 20,000 records on the first tier

I've thought about using, say, "TOP 100", in my SelectCommand's CommandText, but how do I smoothly continue the populating when the user attempts to view more nodes by scrolling down?
Nov 20 '05 #3


----- Armin Zingler wrote: ----

"Only populate the first and second level. As soon as the user expands a nod
from the first level, load the sub nodes of all sub nodes of the expande
node.

A good idea, and I'm already doing that. The situation to which I'm referring, though, is one where there are > 20,000 records on the first tier

I've thought about using, say, "TOP 100", in my SelectCommand's CommandText, but how do I smoothly continue the populating when the user attempts to view more nodes by scrolling down?

Nov 20 '05 #4
"Patrick McGuire" <an*******@discussions.microsoft.com> schrieb


----- Armin Zingler wrote: -----

"Only populate the first and second level. As soon as the user
expands a node from the first level, load the sub nodes of all sub
nodes of the expanded
node."

A good idea, and I'm already doing that. The situation to which I'm
referring, though, is one where there are > 20,000 records on the
first tier.

I've thought about using, say, "TOP 100", in my SelectCommand's
CommandText, but how do I smoothly continue the populating when the
user attempts to view more nodes by scrolling down?

I don't know how to populate it when scrolling down, sorry. I'd say that
20,000 records is much more than a user can handle. Maybe the code to fill
the control can be optimized?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
Group the records in some fashion *above* the top tier, perhaps
alphabetically, or by date (grouping by day, week, or month), or by using
some other suitable categorization. Your goal is to find a way reduce the
number of items in the first tier. I agree with Armin that 20,000 records is
too many to be useful, and as you can see, returning that many records
causes UI problems.

At the same time, I suggest you give users better search/filter options, so
they don't get 20,000 records back.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:On**************@TK2MSFTNGP11.phx.gbl...
"Patrick McGuire" <an*******@discussions.microsoft.com> schrieb


----- Armin Zingler wrote: -----

"Only populate the first and second level. As soon as the user
expands a node from the first level, load the sub nodes of all sub
nodes of the expanded
node."

A good idea, and I'm already doing that. The situation to which I'm
referring, though, is one where there are > 20,000 records on the
first tier.

I've thought about using, say, "TOP 100", in my SelectCommand's
CommandText, but how do I smoothly continue the populating when the
user attempts to view more nodes by scrolling down?

I don't know how to populate it when scrolling down, sorry. I'd say that
20,000 records is much more than a user can handle. Maybe the code to fill
the control can be optimized?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
how about using a hierarchical grid UI instead of a treeview.
Nov 20 '05 #7
>How can I populate it partially during load and then complete it when the
user needs the complete set (i.e. when the user scrolls down)?

Are you serious? Just read 50 records from the DB, and display the form.
Read the rest (and show an hourglass) when the user does something.
Nov 20 '05 #8
Patrick,
Would you consider an alternative to MS TreeView ?

Our TList control

a) Is much faster even if loading all records
directly into memory
( 20,000 records in under 1 SECOND ! )

b) also has a Virtual Load mechanism that triggers
an event where you can supply the data only as
needed.
Basically you tell TList how many nodes you've
got and then fill in the data when the
user scrolls, expands a branch, etc.

For such a small data set ( just 20,000 records )
I would suggest loading directly into memory.
That way you can use TList's other features for
Printing, File I/O, Search, Sort, etc.
Usually we recommend the Virtual loading only
for really large data sets - 50,000 or more
( TList can handle over a million items )
Drop me a note if this sounds interesting to you
I'd be happy to send additional information and
answer any questions you may have about TList.

* * Please include a copy of this note with your reply

Jeff Bennett
Je**@Bennet-Tec.Com

Bennet-Tec Information Systems, Inc
50 Jericho Tpk, Jericho, NY 11753
Phone 516 997 5596, Fax - 5597
WWW.Bennet-Tec.Com

RELIABLE Component Software
and Software Development Services
* TList/Pro * ALLText HT/Pro * MetaDraw *

====================== ======================
-----Original Message----- From "Patrick McGuire"
<an*******@discussions.microsoft.com>
I have a treeview control on a windows form that
I want to populate in the form's load event.
The problem is that the datatable I am using
to populate it contains >20,000 records,
and it takes > 1 min to load the form.
How can I populate it partially during load
and then complete it when the user needs the
complete set (i.e. when the user scrolls down)?


Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2078
by: imassadpk | last post by:
Hi all, Apprecite your help in resolving this tricky issue... I am trying implementing Recurrsive TreeView in MS. Access 2003 ADP project. So far, no luck :( The Problem: This sample snippet is all written for DAO and doesn't work in ADO
2
2667
by: Janus | last post by:
Hello. I need a little advice for populating the treeview control. I dont want my application to hang while populating the treeview, there is a lot of data what's the best approach? Maybe something eventbased but how? please help... Should I avoid populating the treeview control using a thread?
0
1239
by: Henry | last post by:
I have a dataset dsMain in which I have two tables The table period has columns like period_id, name, root_org_id.... The table organization has org_id, name, parent_id, hier_path, level, org_index, and period_id. There is a one to many relationship between period and organization, but the organization is actually a hierarchy....
2
1341
by: Mike | last post by:
Hi all, I have a dataset that contains following records: id ref_id level -------------------------------------- A - 0 A1 A 1 A2 A 1 A3 A 1
0
869
by: Mike | last post by:
Hi all, I have a dataset that contains following records: id ref_id level -------------------------------------- A - 0 A1 A 1 A2 A 1 A3 A 1
0
1286
by: Erland | last post by:
Hello all, I have just installed visual studio .net 2005 and started developing programs in asp.net 2.0. I have a scenerio where I have to populate treeview child nodes based on the entries being entered in textbox,but there is this thing I need to consider. Values in treeview nodes should be populated as nodes, all child nodes in this...
0
2272
by: drop | last post by:
Hi, I'm currently working with the Treeview control in ASP .Net 2.0. The tree is filled dynamically based on data contained in a MySQL Database. Here is the exact behavior I want : 1 - User clicks on a node to expand it. 2 - Add a child node to the node clicked by the user saying the tree is loading that part. So here, I also need to...
2
3167
by: Steve Arndt | last post by:
I'm trying to populate a vb.net treeview using a SQLDataReader at Treeview1_BeforeExpand. Basically I have a Treeview with 5 parent nodes and 1 dummy child node per parent. The first parent node is called Address is the parent I'm trying to add new children under. When BeforeExpand is triggered, it removes the dummy child under the Adress...
7
7818
by: Joe Cool | last post by:
Let's say I have a Treeview control on a form. Each leaf node in the Treeview has a ContextMenuStrip, each with one ToolStripMenuItem, and all ToolStripMenuItems Click event is handled by a comment event handler. How do I determine which Treeview Node signalled the menu event in the common event handler?
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7394
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5701
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.