blazor-devexpress-dot-blazor-dot-dxribboncomboboxitem-2-2420c196.md
Specifies a collection that supplies data for the ribbon combo box item.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(null)]
[Parameter]
public IEnumerable<TData> Data { get; set; }
| Type | Default | Description |
|---|---|---|
| IEnumerable<TData> | null |
A data collection.
|
Use the Data property to bind the ribbon combo box item to a data collection or enumeration. Initialize this object in the OnInitialized lifecycle method or before this method is invoked.
...
<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;
}
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),
};
}
DevExpress.Blazor.Ribbon.IRibbonComboBox<TData, TValue>.Data
See Also
DxRibbonComboBoxItem<TData, TValue> Class