TreeView.ImageSet Property

Gets or sets the group of images to use for the TreeView control.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public:
property TreeViewImageSet ImageSet {
	TreeViewImageSet get ();
	void set (TreeViewImageSet value);
}
/** @property */
public TreeViewImageSet get_ImageSet ()

/** @property */
public void set_ImageSet (TreeViewImageSet value)

public function get ImageSet () : TreeViewImageSet

public function set ImageSet (value : TreeViewImageSet)

Not applicable.

Property Value

One of the TreeViewImageSet values. The default is TreeViewImageSet.Custom.

Exception typeCondition

ArgumentOutOfRangeException

The specified image set is not one of the TreeViewImageSet values.

Use 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.

NoteNote:

The ImageSet property does not affect any style settings for a node. Set the appropriate style property, such as the NodeStyle property, if you want to add custom colors and spacing.

The following table lists the valid values for The ImageSet property.

Image set

Description

TreeViewImageSet.Arrows

A predefined image set that uses arrow images.

TreeViewImageSet.BulletedList

A predefined image set that uses diamond-shaped bullet images.

TreeViewImageSet.BulletedList2

A predefined image set that uses square-shaped bullet images.

TreeViewImageSet.BulletedList3

A predefined set of sectioned, diamond shaped bullet images.

TreeViewImageSet.BulletedList4

A predefined set of alternate sectioned, diamond shaped bullet images in sizes that vary by level.

TreeViewImageSet.Contacts

A predefined image set that uses MSN Messenger images.

TreeViewImageSet.Custom

A user-defined image set.

TreeViewImageSet.Events

A predefined image set that uses event log-styled images.

TreeViewImageSet.Faq

A predefined image set that uses FAQ-styled images.

TreeViewImageSet.Inbox

A predefined image set that uses e-mail-styled images.

TreeViewImageSet.News

A predefined image set that uses newsgroup-styled images.

TreeViewImageSet.Simple

A predefined image set that uses simple shape outlines.

TreeViewImageSet.Simple2

A predefined image set that uses simple filled shapes.

TreeViewImageSet.Msdn

A predefined image set that uses MSDN images.

TreeViewImageSet.WindowsHelp

A predefined image set that uses Microsoft Windows Help images.

TreeViewImageSet.XPFileExplorer

A predefined image set that uses Windows Explorer images available in Microsoft Windows XP.

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.

Property

Description

CollapseImageUrl

The URL to a custom image for the collapsible node indicator.

ExpandImageUrl

The URL to a custom image for the expandable node indicator.

LineImagesFolder

The URL to a folder that contains custom images for the lines that connect nodes.

NoExpandImageUrl

The URL to a custom image for the non-expandable node indicator.

The value of this property is stored in view state.

The following code example demonstrates how to use the ImageSet property to display the Windows Explorer set of images in the TreeView control.

No code example is currently available or this language may not be supported.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: