Back to Devexpress

DxRibbonComboBoxItem<TData, TValue>.EditText Property

blazor-devexpress-dot-blazor-dot-dxribboncomboboxitem-2-10720542.md

latest3.2 KB
Original Source

DxRibbonComboBoxItem<TData, TValue>.EditText Property

Specifies the text displayed in the edit box of the Ribbon’s combo box.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(null)]
[Parameter]
public string EditText { get; set; }

Property Value

TypeDefaultDescription
Stringnull

The combo box text.

|

Remarks

Set AllowUserInput to true to allow users type custom values into the Ribbon’s combo box. The EditText property specifies the text displayed in the box.

The combo box updates EditText and fires the EditTextChanged event when a user does one of the following:

  • Changes the text and removes focus from the combo box.
  • Changes the text and presses Enter.
  • Selects an item in the drop-down list.

Note

Typed values are not inserted into the bound data source or added to the drop-down list. If a user enters a value equal to an existing item, the combo box selects that item.

The following code snippet specifies the custom font size in the Ribbon’s combo box:

razor
<DxRibbon>
    <DxRibbonTab Text="Home">
        <DxRibbonGroup Text="Style">
            <DxRibbonItem Text="Bold" IconCssClass="dx-icon-bold" />
            <DxRibbonItem Text="Italic" IconCssClass="dx-icon-italic" />
            <DxRibbonItem Text="Underline" IconCssClass="dx-icon-underline" />
            <DxRibbonComboBoxItem Data="FontSizes"
                                  Value="@CurrentFontSize"
                                  TextFieldName="@nameof(FontSizeInfo.Size)"
                                  AllowUserInput="true"
                                  EditText="15"
                                  NullText="Font Size"
                                  Width="120px" />
        </DxRibbonGroup>
    </DxRibbonTab>
</DxRibbon>
csharp
public class FontSizeInfo
{
    public int Size { get; private set; }

    public FontSizeInfo(int size)
    {
        Size = size;
    }

    public static readonly FontSizeInfo[] DefaultFontSizes = new FontSizeInfo[] {
        new FontSizeInfo(8),
        new FontSizeInfo(10),
        new FontSizeInfo(12),
        new FontSizeInfo(14),
        new FontSizeInfo(18),
        new FontSizeInfo(24),
        new FontSizeInfo(28),
        new FontSizeInfo(32)
    };
}

Implements

DevExpress.Blazor.Ribbon.IRibbonComboBox<TData, TValue>.EditText

See Also

DxRibbonComboBoxItem<TData, TValue> Class

DxRibbonComboBoxItem<TData, TValue> Members

DevExpress.Blazor Namespace