Skip to main content

RichEditBarItemNames.AutoFitContents Property

Gets the Auto Fit Contents item’s name.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v24.1.dll

NuGet Package: DevExpress.Blazor.RichEdit

Declaration

public static string AutoFitContents { get; }

Property Value

Type Description
String

The “AutoFitContents” string.

Remarks

Use this property to perform the following operations with the Auto Fit Contents item:

The Auto Fit Contents item is a button in the Table Auto Fit Menu. This button automatically resets the width of each column in the selected table according to the column’s content.

The following code snippet removes the Auto Fit Contents item from the Table Auto Fit Menu:

<DxRichEdit CustomizeRibbon="onCustomizeRibbon" />

@code {
    void onCustomizeRibbon(IRibbon ribbon) {
        IBarItem tableAutoFitMenu = ribbon.Tabs[RichEditRibbonTabNames.TableLayout]
        .Groups[RichEditRibbonGroupNames.LayoutAutoFit]
        .Items[RichEditBarItemNames.TableAutoFitMenu];
        if (tableAutoFitMenu.Type == BarItemTypes.DropDown) {
            IBarDropDown tableAutoFitDropDown = (IBarDropDown)tableAutoFitMenu;
            tableAutoFitDropDown.Items.Remove(RichEditBarItemNames.AutoFitContents);
            tableAutoFitDropDown.Items.Remove(RichEditBarItemNames.AutoFitWindow);
            tableAutoFitDropDown.Items.Remove(RichEditBarItemNames.FixedColumnWidth);
        }
    }
}
See Also