VIBlend
Home Products Downloads Purchase Support Forum About Blog

Silverlight TreeView with Radio Button

by viblend 16. February 2012 21:15
This post will show you how to add radio buttons to the TreeView items.

In order to display radio buttons in the VIBlend TreeView for Silverlight, you need to set the EnableCheckboxes property to true and also the ListItemType of each TreeViewItem to "RadioButton".

For example:

<viblend:TreeView EnableCheckBoxes="True" Width="280" Height="300" x:Name="TreeView">
    <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="VIBlend" Value="VIBlend" ImageSource="/Images/user.png">
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Contacts" Value="Contacts" ImageSource="/Images/contacts.png"/>
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Desktop" Value="Desktop" ImageSource="/Images/desktop.png"/>
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Documents" Value="Documents" ImageSource="/Images/documents.png"/>
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Downloads" Value="Downloads" ImageSource="/Images/folder.png"/>
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Favorites" Value="Favorites" ImageSource="/Images/favorites.png"/>
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Music" Value="Music" ImageSource="/Images/music.png"/>
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Pictures" Value="Pictures" ImageSource="/Images/Pictures.png"/>
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Searches" Value="Searches" ImageSource="/Images/searches.png"/>
        <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Videos" Value="Videos" ImageSource="/Images/videos.png"/>
    </viblend:TreeViewItem>
    <viblend:TreeViewItem ListItemType="RadioButton" DisplayValue="Inbox" Value="Inbox" ImageSource="/Images/folder.png"/>
</viblend:TreeView>

Here's the resulting TreeView:
  
Comments are closed

About the author

Some text that describes me

Tag cloud

Recent comments

Comment RSS
Copyright © 2011 VIBlend  
ALL RIGHTS RESERVED  
 
Terms of Use | Privacy Policy
WinForms Controls Purchase Online About Us
       
DataGrid Navigation Pane Technical Support Blog
ScrollBar TreeView
ListBox ProgressBar Downloads Register
ComboBox Buttons
TabControl Editors Documentation Client Login

VIBlend Blog is powered by BlogEngine.NET