Skip to main content
Tab

FileManagerFileListThumbnailsViewSettings.ThumbnailSize Property

OBSOLETE

Use ThumbnailWidth and ThumbnailHeight properties instead.

Gets or sets the file thumbnail‘s size in pixels.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.2.dll

Declaration

[DefaultValue(typeof(Unit), "")]
[Obsolete("Use ThumbnailWidth and ThumbnailHeight properties instead.")]
public virtual Unit ThumbnailSize { get; set; }

Property Value

Type Default Description
Unit

String.Empty

A Unit object that specifies the size.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to ThumbnailSize
ASP.NET Bootstrap Controls BootstrapFileManagerSettingsFileList
.ThumbnailsViewSettings.ThumbnailSize
ASP.NET Web Forms Controls HtmlEditorDocumentSelectorFileListSettings
.ThumbnailsViewSettings.ThumbnailSize
HtmlEditorFileManagerFileListSettings
.ThumbnailsViewSettings.ThumbnailSize
FileManagerSettingsFileList
.ThumbnailsViewSettings.ThumbnailSize

Remarks

This property affects thumbnails displayed in ASPxFileManager file list in thumbnails view (when the FileManagerSettingsFileList.View property is set to Thumbnails). The ThumbnailSize property specifies the side of a square that limits a thumbnail size.

To specify the thumbnail size for file list in details view, use the FileManagerFileListDetailsViewSettings.ThumbnailSize property.

Example

Web Forms:

<dx:ASPxFileManager ID="fileManager" runat="server">
    <SettingsFileList>
        <ThumbnailsViewSettings ThumbnailSize="100" ThumbnailHeight="50" ThumbnailWidth="50">
            <ItemTemplate>
                <img class="tmplThumb" src='<%# Eval("ThumbnailUrl") %>' alt='<%# Eval("Name") %>' />
                <div class="tmplTextContainer">
                    <dx:ASPxLabel CssClass="mainInfo" runat="server" Text='<%# Eval("Name") %>' />
                    <br />
                    <dx:ASPxLabel CssClass="additionalInfo" runat="server" Text='<%# GetFileType(Container.DataItem as FileManagerFile) %>' />
                    <br />
                    <dx:ASPxLabel CssClass="additionalInfo" runat="server" Text='<%# GetSize(Container.DataItem as FileManagerFile) %>' />
                </div>
            </ItemTemplate>
        </ThumbnailsViewSettings>
    </SettingsFileList>
    ...
</dx:ASPxFileManager>

MVC:

settings.SettingsFileList.ThumbnailsViewSettings.ThumbnailHeight = Unit.Pixel(50);
settings.SettingsFileList.ThumbnailsViewSettings.ThumbnailWidth = Unit.Pixel(50);
settings.SettingsFileList.ThumbnailsViewSettings.ThumbnailSize = Unit.Pixel(100);
settings.SettingsFileList.ThumbnailsViewSettings.SetThumbnailViewItemTemplateContent(c => {
    ViewContext.Writer.Write(
        "<img class=\"tmplThumb\" src=\"" + c.Item.ThumbnailUrl + "\" alt='<%# Eval(\"Name\") %>' />" +
        "<div class=\"tmplTextContainer\">" +
            "<span>" + DataBinder.Eval(c.DataItem, "Name") + "</span>" +
            "<br />" +
            "<span class=\"additionalInfo\">" + FileManagerItemInfo.Create("", c.Item.FullName).Type + "</span>" +
            "<br />" +
            "<span class=\"additionalInfo\">" + c.Item.Length / 1024 + "Kb </span>" +
        "</div>"
    );
});

Online Demo

See Also