Back to Devexpress

DxRibbonComboBoxItem<TData, TValue>.Value Property

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

latest2.4 KB
Original Source

DxRibbonComboBoxItem<TData, TValue>.Value Property

Specifies the combobox item value.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(null)]
[Parameter]
public TValue Value { get; set; }

Property Value

TypeDefaultDescription
TValuenull

The item value.

|

Remarks

Use the Value property to specify the editor’s value or to bind the value to a data source object. You can use the @bind attribute to bind the Value property to a data field. Refer to the following topic for details: Two-Way Data Binding.

To respond to the value change, handle the ValueChanged event.

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

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

See Also

DxRibbonComboBoxItem<TData, TValue> Class

DxRibbonComboBoxItem<TData, TValue> Members

DevExpress.Blazor Namespace