Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / March 2006

Tip: Looking for answers? Try searching our database.

What is up with the TreeView ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Philip - 02 Mar 2006 15:45 GMT
Is there really no way of binding the treeview to a datasource like an XML
Document?

Surely, given that XML is hierarchical and the Tree View control is
hierarchical I would expect Microsoft to have extended it for us, instead of
us having to loop through a huge XML document adding nodes one by one?

Is Microsoft doing something about this - in VB6 it was better!

Or do we have to build our own treeview from scratch in order to shadow an
XML Document?

Our problem is we are displaying the nodes of a huge XML document that the
user can edit, and it takes far too long to reload the treeview.

thx for any help or advice
Nick Hounsome - 02 Mar 2006 16:30 GMT
> Is there really no way of binding the treeview to a datasource like an XML
> Document?
[quoted text clipped - 3 lines]
> of
> us having to loop through a huge XML document adding nodes one by one?

But what would this binding show?

How would it know what the child nodes were?

Tree's are inherently more complicated than lists and it is hard to see what
sort of binding model could work in general.

> Is Microsoft doing something about this - in VB6 it was better!
>
> Or do we have to build our own treeview from scratch in order to shadow an
> XML Document?

There are numerous ways to represent an XmlDocument in a tree.
The most obvious question is "how do you represent attributes?"

> Our problem is we are displaying the nodes of a huge XML document that the
> user can edit, and it takes far too long to reload the treeview.

How could it be any quicker if it used databinding?
There are lots of ways to gain and lose performance with tree views.
Are you using BeginUpdate() and EndUpdate()?
Grant Frisken - 06 Mar 2006 21:47 GMT
If you are open to a commercial solution you could take a look at
Infralutions Virtual Tree.  It does provide a general purpose data
binding model that works very well.  Data binding does provide the
possiblity of real performance improvements because only those nodes
that actually need to be displayed for the current tree state need to
be loaded.   This means you can display a tree containing millions of
items extremely quickly because you only have to load 30-40 items.

>From memory there are some issues binding to XmlDocument and XmlNode
due to the fact that Virtual Tree requires the collection to support
the standard IList interface which XmlNode (being a wrapper for a COM
object) does not.   This can however be overcome by using Virtual
Tree's programmatic binding interface and providing an adaptor class.

If you are interested you can get more information and download an
evaluation version from:

www.infralution.com/virtualtree.html

Regards
Grant Frisken
Infralution

> > Is there really no way of binding the treeview to a datasource like an XML
> > Document?
[quoted text clipped - 25 lines]
> There are lots of ways to gain and lose performance with tree views.
> Are you using BeginUpdate() and EndUpdate()?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.