Tab

FileManagerThumbnailCreateEventArgs.ThumbnailImage Property

Gets the settings of a thumbnail image.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

public FileManagerThumbnailProperties ThumbnailImage { get; }
Public ReadOnly Property ThumbnailImage As FileManagerThumbnailProperties

Property Value

Type Description
FileManagerThumbnailProperties

A FileManagerThumbnailProperties object that contains image settings.

Remarks

The ASPxFileManager allows you to provide custom thumbnails by handling the ASPxFileManager.CustomThumbnail server event. Within the event's handler, a custom thumbnail can be defined for the currently processed file via the ThumbnailImage property.

Examples

In the example below, the CustomThumbnail event is handled to analyze file extensions and represent each file type using the corresponding custom thumbnail image.

public void ASPxFileManager1_CustomThumbnail(object source, DevExpress.Web.FileManagerThumbnailCreateEventArgs e) {
        switch(((FileManagerFile)e.Item).Extension) {
            case ".avi":
                e.ThumbnailImage.Url = "Images/movie.png";
                break;
            case ".zip":
                e.ThumbnailImage.Url = "Images/archive.png";
                break;
            case ".txt":
                e.ThumbnailImage.Url = "Images/txt.png";
                break;
            case ".rtf":
                e.ThumbnailImage.Url = "Images/richtxt.png";
                break;
            case ".mp3":
                e.ThumbnailImage.Url = "Images/music.png";
                break;
            case ".xml":
                e.ThumbnailImage.Url = "Images/code.png";
                break;
        }
}
See Also