blazor-devexpress-dot-blazor-dot-dxribboncomboboxitem-2-fc070cd5.md
Specifies whether users can enter custom values in the edit box of the combo box item.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(false)]
[Parameter]
public bool AllowUserInput { get; set; }
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true to allow users to enter new values in the edit box; false to allow users to only select values from the drop-down window.
|
Set the AllowUserInput property to true to allow users to type custom values into the edit box of the ribbon combo box item. The item does not add these values to the bound data source or a drop-down window. If a user enters a value equal to a drop-down window item, the editor selects the corresponding item.
...
<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>.AllowUserInput
See Also
DxRibbonComboBoxItem<TData, TValue> Class