Export (0) Print
Expand All

SPListItem.IconOverlay Property

Gets or sets the URL to an overlay icon for this item.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

public string IconOverlay { get; set; }

Property Value

Type: System.String
A string that contains the URL relative to the Template/Images directory.

An icon overlay is a small image that can be used to represent an item in a list view.

The following example is a console application that sets the IconOverlay property for the first item in the Announcements list of a Web site.

using System;
using Microsoft.SharePoint;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite site = new SPSite("http://localhost"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPList list = web.GetList("/lists/announcements");
                    if (list.ItemCount > 0)
                    {
                        SPListItem item = list.Items[0];
                        item.IconOverlay = "announce.gif";
                        item.Update();
                        Console.WriteLine(item.IconOverlay);
                    }
                }
            }
            Console.ReadLine();
        }
    }
}

Show:
© 2014 Microsoft