Back to Devexpress

DxRibbonComboBoxItem<TData, TValue>.SearchMode Property

blazor-devexpress-dot-blazor-dot-dxribboncomboboxitem-2-7ecc43e8.md

latest2.6 KB
Original Source

DxRibbonComboBoxItem<TData, TValue>.SearchMode Property

Specifies whether the component can search for text that users type in the edit box.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(null)]
[Parameter]
public ListSearchMode SearchMode { get; set; }

Property Value

TypeDefaultDescription
ListSearchModenull

An enumeration value.

|

Available values:

NameDescription
Default

AutoSearch is used. The component automatically searches for text that users type in the edit box.

| | None |

The filter is not applied to list items.

| | AutoSearch |

The component searches for text that users type in the edit box.

|

Remarks

Use the SearchMode property to change how the combo box editor searches for text.

The following snippet disables search in the combo box editor:

razor
<DxRibbon>
    <DxRibbonTab Text="Home">
        <DxRibbonGroup>
            <DxRibbonComboBoxItem Data="FontSizes"
                                  @bind-Value="CurrentFontSize"
                                  TextFieldName="@nameof(FontSizeInfo.Size)"
                                  AllowUserInput="true"
                                  NullText="Font Size" 
                                  SearchMode="@ListSearchMode.None" />
        </DxRibbonGroup>
    </DxRibbonTab>
</DxRibbon>

@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)
    };
}

Implements

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

See Also

DxRibbonComboBoxItem<TData, TValue> Class

DxRibbonComboBoxItem<TData, TValue> Members

DevExpress.Blazor Namespace