Back to Devexpress

DxRibbonComboBoxItem<TData, TValue> Class

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

latest3.2 KB
Original Source

DxRibbonComboBoxItem<TData, TValue> Class

A ribbon item that displays a combo box editor.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public class DxRibbonComboBoxItem<TData, TValue> :
    DxRibbonItemBase,
    IRibbonComboBox<TData, TValue>,
    IRibbonGroupItem,
    IRibbonGroupElement,
    IRibbonElement,
    IRibbonNode,
    IRibbonInteractiveElement,
    IRibbonElementFocusController,
    IRibbonEditableElement

Type Parameters

NameDescription
TData

The type of data.

| | TValue |

The type of values.

|

Remarks

A combo box item allows users to select predefined items from a drop-down list or type custom values directly.

Use the Value property to specify the editor’s value or to bind the value to a data source object. Handle the ValueChanged event to respond to the value change.

razor
...
<DxRibbonComboBoxItem Data="FontSizes"
                      @bind-Value="CurrentFontSize"
                      TextFieldName="@nameof(FontSizeInfo.Size)"
                      AllowUserInput="true"
                      NullText="Font Size"
                      Width="120px" />
...
@code {
    private FontSizeInfo CurrentFontSize { get; set; }
    private IEnumerable<FontSizeInfo> FontSizes => FontSizeInfo.DefaultFontSizes;
}
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),
        };
}

Implements

IComponent

IHandleEvent

IHandleAfterRender

IDisposable

IRibbonComboBox<TData, TValue>

Inheritance

Object ComponentBase DevExpress.Blazor.Ribbon.Internal.DxRibbonNodeBase DxRibbonElementBase DxRibbonItemBase DxRibbonComboBoxItem<TData, TValue>

See Also

DxRibbonComboBoxItem<TData, TValue> Members

DevExpress.Blazor Namespace