Tab
A newer version of this page is available. Switch to the current version.

FileManagerToolbarCustomButton Class

Implements the custom toolbar item's functionality.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public class FileManagerToolbarCustomButton :
    FileManagerToolbarItemBase
Public Class FileManagerToolbarCustomButton
    Inherits FileManagerToolbarItemBase

Remarks

The file manager stores a FileManagerToolbarCustomButton object in the FileManagerToolbarItemCollection collection. Use theFileManagerSettingsContextMenu.Items or FileManagerSettingsToolbar.Items properties to access this collection.

Concept

Toolbar

Example

Declaratively:

<dx:ASPxFileManager ID="FileManager" ClientInstanceName="FileManager" runat="server" />
    <SettingsToolbar>
        <Items>
            <dx:FileManagerToolbarRefreshButton BeginGroup="false" />
            <dx:FileManagerToolbarCustomButton Text="Thumbnails View" CommandName="ChangeView-Thumbnails" 
            GroupName="ViewMode">
                <Image IconID="grid_cards_16x16" />
            </dx:FileManagerToolbarCustomButton>
            ...
        </Items>
    </SettingsToolbar>
</dx:ASPxFileManager>

In code:

ASPxFileManager fm = new ASPxFileManager();
...
FileManagerToolbarRefreshButton refresh = new FileManagerToolbarRefreshButton();
refresh.BeginGroup = false;

FileManagerToolbarCustomButton customButton = new FileManagerToolbarCustomButton();
customButton.Text = "Thumbnails View";
customButton.CommandName = "ChangeView-Thumbnails";
customButton.GroupName = "ViewMode";
customButton.Image.IconID = "grid_cards_16x16";

fm.SettingsToolbar.Items.Add(refresh);
fm.SettingsToolbar.Items.Add(customButton);

MVC:

@Html.DevExpress().FileManager( settings => {
    settings.Name = "fileManager";

    FileManagerToolbarRefreshButton refresh = new FileManagerToolbarRefreshButton();
    refresh.BeginGroup = false;

    FileManagerToolbarCustomButton customButton = new FileManagerToolbarCustomButton();
    customButton.Text = "Thumbnails View";
    customButton.CommandName = "ChangeView-Thumbnails";
    customButton.GroupName = "ViewMode";
    customButton.Image.IconID = "grid_cards_16x16";

    settings.SettingsToolbar.Items.Add(refresh);
    settings.SettingsToolbar.Items.Add(customButton);

    ...
}).BindToFolder(Model).GetHtml()

Online Demo

See Also