473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Populating Treeview

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?

And for something more general what's the best way to populate different controls - is it a sin to thread it? or ?
Kind regards

Nov 16 '05 #1
2 2656
Hi Janus,
Try just to populate the collapsed parent nodes, not all of the child nodes. While doing that rather than quering db in every Expand, fetch all data you need from db during load of your form and when TreeView Expand event occurs just create controls (treenodes) by quering disconnected dataset in memory..
Good Luck,
--
Dincer Ozturan

"Janus" wrote:
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?

And for something more general what's the best way to populate different controls - is it a sin to thread it? or ?
Kind regards

Nov 16 '05 #2
Yes, a good idea..
--
Dincer Ozturan
"C Addison Ritchie" wrote:
Combine Dincer's suggestions with some ansynchronous data loading may be helpful too.

Do what Dincer said but for loading the parent nodes of the treeview use a DataReader that returns just these parent nodes. In the background use an asynchronous call to load the entire DataSet as suggested.

Could work maybe.

--
C Addison Ritchie, MCSD
Ritch Consulting, Inc.
"Dincer Ozturan" wrote:
Hi Janus,
Try just to populate the collapsed parent nodes, not all of the child nodes. While doing that rather than quering db in every Expand, fetch all data you need from db during load of your form and when TreeView Expand event occurs just create controls (treenodes) by quering disconnected dataset in memory..
Good Luck,
--
Dincer Ozturan

"Janus" wrote:
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?

And for something more general what's the best way to populate different controls - is it a sin to thread it? or ?
Kind regards

Nov 16 '05 #3

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

Similar topics

2
by: Karuppasamy | last post by:
Hi I want to populate all the files and folders of System in a Treeview control like Windows Explorer. I try this using File System Objects. But sometimes I am getting an error like 'Access...
0
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...
0
by: N-Mayne | last post by:
Hi i was wondering if anyone knew how to Populating a TreeView control with the contents of a class and varibles etc, like netbean does but in C#. Thanks Nick Posted Via Usenet.com Premium...
1
by: naijacoder naijacoder | last post by:
Hi Guys, I have an application below that is treeview menu populated from the database which works with asp.net webmatrix.But when i put it into code behind in Visual Studio.Net it gives the...
0
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...
0
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...
2
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...
0
by: hardieca | last post by:
Hi, I have created a treeview bound to a sitemap provider. I have put it into a user control (the control will be used for similar, but not always identical, functionality). The treeview...
2
by: Maddy | last post by:
I need to populate a treeview from a text file. The data in it is in the following form 1. (Parent Node) (a) (Child Node) (b) (Child Node) .. .. .. (k) (Child Node)
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.