Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Binding a TreeView to a large dataset.

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 04-13-2006   #1 (permalink)
Tom
Guest


 

Binding a TreeView to a large dataset.

I have a large XML document that I'm binding to a TreeView for testing
purposes. There are relatively few nodes at depth=1 so the tree is
displayed quickly. However there are a lot of nodes at depth=2 (200-300
per depth=1 node) and expanding the closed depth=1 nodes causes the UI
to freeze whilst the binding occurs.

As the freeze happens when I try to expand the node, I'm assuming that
the TreeView is 'lazy' binding to the XML data.

Here is the XAML (I'm setting the DataContext of the TreeView in code) :

<HierarchicalDataTemplate DataType="section"
ItemsSource="{Binding XPath=section}">
<TextBlock Text="{Binding XPath=@description}"/>
</HierarchicalDataTemplate>

<TreeView Name="_sectionTree"
ItemsSource="{Binding XPath=/sites/section}"
BorderThickness ="0">

I have a few questions.

1) Is it the binding that is freezing the UI?
2) Is there a better way to perform the binding so that the UI does not
freeze?
3) If not, are there any events that I can handle do give user feedback
before and after the binding occurs? i.e. change the cursor or display
a 'loading...' node.

Cheers

Tom.

My System SpecsSystem Spec
Old 04-20-2006   #2 (permalink)
Jonathan MacCollum
Guest


 

RE: Binding a TreeView to a large dataset.

Tom,
I'm having a similar problem. I've got a ListBox templated with a
HierarchicalDataTemplate. When I bind a couple of hundred items to the list
it freezes up the UI, and when I un-bind those and bind a smaller subset, it
takes just as long. However going from one small list of items to another
small list of items, it does not freeze up the UI.

Can anyone shed some light on this?
My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding inside binding question Yoavo Avalon 0 12-03-2007 08:24 AM
Binding to a Foreign Key Binding? -=B3N=- Avalon 0 06-14-2007 06:45 AM
Binding Question (Binding in General) Jason Avalon 2 05-09-2007 04:41 AM
Binding to a DataSet and related rows jmagaram Avalon 3 10-12-2006 12:20 PM
Drag and Drop Treeview Items between 2 Treeview ProjectGKR Avalon 3 03-14-2006 07:29 AM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51