<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>A TreeView, a HierarchicalDataTemplate, and a 2D collection walk into a bar ...</title><link>http://blogs.msdn.com/mikehillberg/archive/2006/10/11/a-treeview-a-hierarchicaldatatemplate-and-a-2d-collection-walk-into-a-bar.aspx</link><description>An example of a TreeView and HierarchicalDataTemplate being used to display a collection of collections.</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: A TreeView, a HierarchicalDataTemplate, and a 2D collection walk into a bar ...</title><link>http://blogs.msdn.com/mikehillberg/archive/2006/10/11/a-treeview-a-hierarchicaldatatemplate-and-a-2d-collection-walk-into-a-bar.aspx#1834835</link><pubDate>Thu, 08 Mar 2007 11:58:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1834835</guid><dc:creator>zajda82</dc:creator><description>&lt;p&gt;Is there any way of binding some TreeCollection to WPF TreeView? If we dont know how many levels this collection will have?&lt;/p&gt;
</description></item><item><title>re: A TreeView, a HierarchicalDataTemplate, and a 2D collection walk into a bar ...</title><link>http://blogs.msdn.com/mikehillberg/archive/2006/10/11/a-treeview-a-hierarchicaldatatemplate-and-a-2d-collection-walk-into-a-bar.aspx#2345527</link><pubDate>Tue, 01 May 2007 01:59:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2345527</guid><dc:creator>MikeHillberg</dc:creator><description>&lt;P&gt;Re: "Is there any way of binding some TreeCollection to WPF TreeView? If we dont know how many levels this collection will have?"&lt;/P&gt;
&lt;P&gt;Yes, TreeView expands to any depth. &amp;nbsp;If you look at the ItemTemplate for the TreeView above, you see it is a HierarchicalDataTemplate with an ItemsSource:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;HierarchicalDataTemplate&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ItemsSource&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;{Binding Path=Animals}&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;That ItemsSource property explains how, at each level of the tree view, to find the next level.&lt;/P&gt;
&lt;P&gt;This post from Bea (&lt;A href="http://www.beacosta.com/2006/02/how-do-i-display-grouped-data-in.html" target=_new rel=nofollow&gt;http://www.beacosta.com/2006/02/how-do-i-display-grouped-data-in.html&lt;/A&gt;) and this from Karsten (&lt;A href="http://blogs.msdn.com/karstenj/archive/2005/11/02/488420.aspx"&gt;http://blogs.msdn.com/karstenj/archive/2005/11/02/488420.aspx&lt;/A&gt;) have more info on TreeView and HierarchicalDataTemplate.&lt;/P&gt;</description></item><item><title>re: A TreeView, a HierarchicalDataTemplate, and a 2D collection walk into a bar ...</title><link>http://blogs.msdn.com/mikehillberg/archive/2006/10/11/a-treeview-a-hierarchicaldatatemplate-and-a-2d-collection-walk-into-a-bar.aspx#3659107</link><pubDate>Mon, 02 Jul 2007 15:30:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3659107</guid><dc:creator>kidsysco</dc:creator><description>&lt;p&gt;Could not get the example to work, it does not care for the DataTemplate tag nested in the HeirarchicalDataTemplate.ItemTemplate tag.&lt;/p&gt;
&lt;p&gt;Was this example tested?&lt;/p&gt;
</description></item><item><title>re: A TreeView, a HierarchicalDataTemplate, and a 2D collection walk into a bar ...</title><link>http://blogs.msdn.com/mikehillberg/archive/2006/10/11/a-treeview-a-hierarchicaldatatemplate-and-a-2d-collection-walk-into-a-bar.aspx#3702350</link><pubDate>Thu, 05 Jul 2007 14:33:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3702350</guid><dc:creator>kidsysco</dc:creator><description>&lt;p&gt;OK I got this example to build. I think that it is important to deliver folks at least a little info on the namespace delcared at the top of the XAML file. I do have a fundamental understanding of WPF and I can manage to get alot done with it but I did not realize that the XAML needs a reference to the namespace that it is operating in. I guess that just sounds weird to me and I do not quite understand why. I will go ahead and read those sections of the WPF spec again to see if I can figure out why.&lt;/p&gt;
&lt;p&gt;xmlns:local=&amp;quot;clr-namespace:HierarchicalDataTemplateTest&amp;quot;&lt;/p&gt;
&lt;p&gt;I had to change that line to ...&lt;/p&gt;
&lt;p&gt;xmlns:local=&amp;quot;clr-namespace:myNameSpaceForThisXamlFile&amp;quot;&lt;/p&gt;
&lt;p&gt;Thanks for your help Mike!&lt;/p&gt;
</description></item><item><title>re: Could not get the example to work</title><link>http://blogs.msdn.com/mikehillberg/archive/2006/10/11/a-treeview-a-hierarchicaldatatemplate-and-a-2d-collection-walk-into-a-bar.aspx#3709245</link><pubDate>Thu, 05 Jul 2007 20:19:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3709245</guid><dc:creator>MikeHillberg</dc:creator><description>&lt;P&gt;Sorry kidsysco, you're right; I should have called that out and included the namespace in the .cs part of the sample.&amp;nbsp;&amp;nbsp;I've updated it now.&lt;/P&gt;
&lt;P&gt;Thanks for posting the comment!&lt;/P&gt;</description></item><item><title>Load a Treeview on Demand ...</title><link>http://blogs.msdn.com/mikehillberg/archive/2006/10/11/a-treeview-a-hierarchicaldatatemplate-and-a-2d-collection-walk-into-a-bar.aspx#4957106</link><pubDate>Mon, 17 Sep 2007 17:35:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4957106</guid><dc:creator>Remora</dc:creator><description>&lt;p&gt;I try hard to load data only when user click on leaf.&lt;/p&gt;
&lt;p&gt;I have succeeded in creating Treeview data in one shot but data are very heavy to load and I'd like to go down in tree only when needed ...&lt;/p&gt;
&lt;p&gt;Ideas guys ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Eric&lt;/p&gt;
</description></item><item><title>re: A TreeView, a HierarchicalDataTemplate, and a 2D collection walk into a bar ...</title><link>http://blogs.msdn.com/mikehillberg/archive/2006/10/11/a-treeview-a-hierarchicaldatatemplate-and-a-2d-collection-walk-into-a-bar.aspx#5287513</link><pubDate>Fri, 05 Oct 2007 10:39:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5287513</guid><dc:creator>anildhan</dc:creator><description>&lt;p&gt;Hello Mike,&lt;/p&gt;
&lt;p&gt;How do we design HierarchicalDataTemplate for nested collections.&lt;/p&gt;
&lt;p&gt;For example&lt;/p&gt;
&lt;p&gt; &amp;lt;Collection&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;Collection&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Collection&amp;gt;&lt;/p&gt;
&lt;p&gt;The above stuff is just a raw example. &lt;/p&gt;
&lt;p&gt;But we can have objects of same types nested inside each other.&lt;/p&gt;
&lt;p&gt;for example,&lt;/p&gt;
&lt;p&gt;Node having list of Nodes.&lt;/p&gt;
&lt;p&gt;Could you please help on this.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;AD&lt;/p&gt;
</description></item></channel></rss>