Back to Devexpress

IRibbonComboBox<TData, TValue> Interface

blazor-devexpress-dot-blazor-dot-ribbon-dot-iribboncombobox-2.md

latest2.2 KB
Original Source

IRibbonComboBox<TData, TValue> Interface

Defines the programmatic interface for the DxRibbonComboBoxItem<TData, TValue> component.

Namespace : DevExpress.Blazor.Ribbon

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public interface IRibbonComboBox<TData, TValue> :
    IRibbonGroupItem,
    IRibbonGroupElement,
    IRibbonElement,
    IRibbonNode,
    IRibbonInteractiveElement

Type Parameters

NameDescription
TData

The type of data.

| | TValue |

The type of values.

|

Remarks

Use the IRibbonComboBox interface to read and modify DxRibbonComboBoxItem<TData, TValue> component properties at runtime and customize the Ribbon combo box editor’s appearance and behavior.

Obtain an IRibbonComboBox instance with the @ref attribute or from Ribbon event arguments.

The following code snippet gets an IRibbonComboBox reference and specifies the text displayed in the edit box of the Ribbon’s combo box:

razor
<DxRibbon>
    <DxRibbonTab Text="Home">
        <DxRibbonGroup>
            <DxRibbonItem Text="Set Font Size"
                          Click="SetFontSize" />
            <DxRibbonComboBoxItem Data="FontSizes"
                                  @bind-Value="CurrentFontSize"
                                  TextFieldName="@nameof(FontSizeInfo.Size)"
                                  @ref="comboBoxReference" />
        </DxRibbonGroup>
    </DxRibbonTab>
</DxRibbon>

@code {
    IRibbonComboBox<FontSizeInfo, FontSizeInfo> comboBoxReference;
    private FontSizeInfo CurrentFontSize { get; set; }
    private IEnumerable<FontSizeInfo> FontSizes => FontSizeInfo.DefaultFontSizes;

    void SetFontSize(RibbonItemClickEventArgs e) {
        comboBoxReference.EditText = "32";
    }
}

See Also

IRibbonComboBox<TData, TValue> Members

DevExpress.Blazor.Ribbon Namespace