TreeViewImageSet Enumeration
TOC
Collapse the table of content
Expand the table of content

TreeViewImageSet Enumeration

 

Represents an image set to use in the TreeView control.

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

public enum TreeViewImageSet

Member nameDescription
Arrows

A predefined set of arrow images.

BulletedList

A predefined set of diamond-shaped bullet images.

BulletedList2

A predefined set of square-shaped bullet images.

BulletedList3

A predefined set of sectioned, diamond shaped bullet images.

BulletedList4

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

Contacts

A predefined set of MSN Messenger–styled images.

Custom

A user-defined set of images. This is the default value of the ImageSet.

Events

A predefined set of event log–styled images.

Faq

A predefined set of FAQ-styled images.

Inbox

A predefined set of e-mail–styled images.

Msdn

A predefined set of Microsoft MSDN developer program–styled images.

News

A predefined set of newsgroup-styled images.

Simple

A predefined set of simple-shaped outline images.

Simple2

A predefined set of filled simple-shaped images.

WindowsHelp

A predefined set of Microsoft Windows Help–styled images.

XPFileExplorer

A predefined set of Windows Explorer for Microsoft Windows XP–styled images.

The TreeViewImageSet enumeration is used to represent the different sets of images that can be displayed in the TreeView control. You can select from a predefined set of images or create your own custom set by setting the ImageSet property to the Custom value. 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 collapsed node indicator.

ExpandImageUrl

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

LineImagesFolder

The URL to a folder that contains custom images for lines-connecting nodes.

NoExpandImageUrl

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

The following code example demonstrates how to use the TreeViewImageSet enumeration to indicate which image set to use in the TreeView control.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>TreeView ImageSet Example</title>
</head>
<body>
    <form id="form1" runat="server">

      <h3>TreeView ImageSet Example</h3>

      <asp:TreeView id="LinksTreeView"
         ImageSet="XPFileExplorer" 
         runat="server">

        <Nodes>

          <asp:TreeNode Value="Home" 
            NavigateUrl="Home.aspx" 
            Text="Home"
            Target="_blank" 
            Expanded="True">

            <asp:TreeNode Value="Page 1" 
              NavigateUrl="Page1.aspx" 
              Text="Page1"
              Target="_blank">

              <asp:TreeNode Value="Section 1" 
                NavigateUrl="Section1.aspx" 
                Text="Section 1"
                Target="_blank"/>

            </asp:TreeNode>              

            <asp:TreeNode Value="Page 2" 
              NavigateUrl="Page2.aspx"
              Text="Page 2"
              Target="_blank">

            </asp:TreeNode> 

          </asp:TreeNode>

        </Nodes>

      </asp:TreeView>

    </form>
  </body>
</html>

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft