Sitecore 5.0 API

ItemAppearance Class

Defines the appearance of the item.

For a list of all members of this type, see ItemAppearance Members.

System.Object
   Sitecore.Data.Appearance
      Sitecore.Data.Items.ItemAppearance

[Visual Basic]
Public Class ItemAppearance
    Inherits Appearance
[C#]
public class ItemAppearance : Appearance

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Appearance defines how the item appears in the Sitecore client.

The Icon property provides the item with a graphical representation.

The Style property defines the CSS style that is applied to item when displayed in the content tree.

Example

The following example builds a listview control containing icons for each version of an item.

public void DisplayVersions(Control parent, Item item) {
  foreach (Item version in item.Versions.GetVersions()) {
    ListviewItem listviewItem = new ListviewItem();

    Sitecore.Context.ClientPage.AddControl(parent, listviewItem);

    listviewItem.ID = "Version" + version.Version.Number.ToString();
    listviewItem.Header = version.Version.Number.ToString();
    listviewItem.Icon = version.Appearance.Icon;
  }
}

Requirements

Namespace: Sitecore.Data.Items

Assembly: Sitecore.Kernel (in Sitecore.Kernel.dll)

See Also

ItemAppearance Members | Sitecore.Data.Items Namespace