Back to Devexpress

TextDisplayMode Enum

blazor-devexpress-dot-blazor-dot-office-ab21c659.md

latest2.2 KB
Original Source

TextDisplayMode Enum

Lists values that specify display mode for the bar item’s text.

Namespace : DevExpress.Blazor.Office

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public enum TextDisplayMode

Members

NameDescription
None

The item text is hidden.

| | Adaptive |

The item text is hidden by default, but displayed on mobile devices or when the item group is collapsed.

| | Auto |

The item text is displayed by default, but hidden if there is not enough space to display all the bar items.

|

The following properties accept/return TextDisplayMode values:

Remarks

Use the TextDisplayMode property to specify text display mode for a bar item.

The following code snippet customizes the toolbar as follows:

  • Clears all groups.
  • Adds a custom Undo/Redo group.
  • Specifies the Adaptive text display mode for the Undo and Redo buttons.
razor
<DxRichEdit BarMode=BarMode.Toolbar
            CustomizeToolbar=OnCustomizeToolbar/>

@code {
    void OnCustomizeToolbar(IToolbar toolbar) {
        BarGroupCollection groups = toolbar.Groups;
        groups.Clear();
        AddUndoRedoGroup(groups);
        // ...
    }
    void AddUndoRedoGroup(BarGroupCollection groups) {
        IBarGroup undoRedoGroup = groups.AddCustomGroup();
        undoRedoGroup.Text = "Undo/Redo";
        undoRedoGroup.IconUrl = "_content/BlazorDemo/images/undo.svg";
        IBarItem undoButton = undoRedoGroup.Items.Add(RichEditBarItemNames.Undo);
        undoButton.TextDisplayMode = TextDisplayMode.Adaptive;
        IBarItem redoButton = undoRedoGroup.Items.Add(RichEditBarItemNames.Redo);
        redoButton.TextDisplayMode = TextDisplayMode.Adaptive;
    }
}

Run Demo: Toolbar Customization

See Also

DevExpress.Blazor.Office Namespace