Skip to main content
Tab

FileManagerThumbnailCreateEventArgs.ThumbnailImage Property

Gets the settings of a thumbnail image.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

NuGet Package: DevExpress.Web

#Declaration

public FileManagerThumbnailProperties ThumbnailImage { get; }

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

#Example

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