SIGN UP MEMBER LOGIN:    
ARTICLE

Load Page on TreeView Node Selection in Silverlight 3

Posted by Diptimaya Patra Articles | Silverlight with C# April 05, 2010
In this article we will see how we can load different pages based on the selection we make in TreeView.
Reader Level:
Download Files:
 

Creating Silverlight Project

Fire up Visual Studio 2008 and create a new Silverlight 3 Project. Name it as LOBSL3.

image1.gif

Let's have a design for our MainPage.xaml.

image2.gif

As you see in above image we have two panes, the left pane would have the Tree View. And the right side pane would contain the target page.

So, let's add one.

image3.gif

So we have several nodes.

Our aim of this article is to load different pages on different TreeView node selection.

So let's have some pages.

Now in TreeViewItem's Selected event we need to clear the value of the Content Border and again set it to our target Page.
Like following:

code.gif

As simple as that, so let's run the application.

image4.gif

image5.gif

image6.gif

image7.gif

This article was requested by one of my article reader, I know it is a simple thing to do, but I gave with some sample so that it would clear.

Hope it helps.
 

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Team Foundation Server Hosting
Become a Sponsor