| |||||||||||||||||||||||||||||||||||||||||||||||||||||
TreeView.ImageSet PropertySystem.Web.UI.WebControls Namespace TreeView Class .NET Framework version 2.0 Sets or retrieves the group of images to use for a TreeView control. Syntax
Property Value
The property is read/write with a default value of Custom. Exceptions
RemarksUse the ImageSet property to specify the group of images to use for the TreeView control. You can either select a predefined set of images to give the control a standard look or define your own custom set.
The following table lists the valid values for the ImageSet property.
When defining a custom set of images, you should specify an image for each of the properties in the following table. Otherwise, the default image for that property is used.
ExampleThe example below shows how to programmatically set the ImageSet property at run time, depending on user input. The code also demonstrates how simple it is to retrieve the available system image sets and dynamically add each to a selectable list. <script language = "C#" runat = "server">
void Page_Load ( Object src, EventArgs e ) {
if ( !IsPostBack ) {
ICollection borders = TypeDescriptor.GetConverter (
typeof ( TreeViewImageSet ) ).GetStandardValues ( );
foreach ( TreeViewImageSet b in borders ) {
ImageSetSelect.Items.Add ( b.ToString ( ) );
}
}
myTreeView.ImageSet = ( TreeViewImageSet ) ImageSetSelect.SelectedIndex;
}
</script>
See Also |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme