blazor-devexpress-dot-blazor-dot-dxribboncomboboxitem-2-9372e60e.md
Fires when a user updates a text in the edit box of the Ribbon’s combo box.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(null)]
[Parameter]
public EventCallback<string> EditTextChanged { get; set; }
| Type | Description |
|---|---|
| String |
The new text.
|
Set AllowUserInput to true to allow users type custom values into the Ribbon’s combo box. The combo box fires the EditTextChanged event when a user does one of the following:
Note
Typed values are not inserted into the bound data source or added to the drop-down list. If a user enters a value equal to an existing item, the combo box selects that item.
The following code snippet displays the value typed in the Ribbon’s combo box:
<DxRibbon>
<DxRibbonTab Text="Home">
<DxRibbonGroup Text="Style">
<DxRibbonItem Text="Bold" IconCssClass="dx-icon-bold" />
<DxRibbonItem Text="Italic" IconCssClass="dx-icon-italic" />
<DxRibbonItem Text="Underline" IconCssClass="dx-icon-underline" />
<DxRibbonComboBoxItem Data="FontSizes"
Value="@CurrentFontSize"
TextFieldName="@nameof(FontSizeInfo.Size)"
AllowUserInput="true"
EditText="@FontSize"
EditTextChanged="OnEditTextChanged"
NullText="Font Size"
Width="120px" />
</DxRibbonGroup>
</DxRibbonTab>
</DxRibbon>
<p><b>Font Size:</b> @FontSize</p>
@code {
string FontSize = "15";
private FontSizeInfo CurrentFontSize { get; set; }
private IEnumerable<FontSizeInfo> FontSizes => FontSizeInfo.DefaultFontSizes;
void OnEditTextChanged(string newValue) {
FontSize = newValue;
}
}
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),
new FontSizeInfo(28),
new FontSizeInfo(32)
};
}
DevExpress.Blazor.Ribbon.IRibbonComboBox<TData, TValue>.EditTextChanged
See Also
DxRibbonComboBoxItem<TData, TValue> Class