alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class SfComboBox<TValue, TItem>

    The ComboBox component enables users to type a value or select an option from a predefined list of options.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    SfBaseComponent
    SfDataBoundComponent
    SfDropDownBase<TItem>
    SfDropDownList<TValue, TItem>
    SfComboBox<TValue, TItem>
    SfAutoComplete<TValue, TItem>
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    SfBaseComponent.Dispose()
    SfBaseComponent.GetEffectivePlatform()
    SfBaseComponent.GetMainComponentPlatform()
    SfBaseComponent.IsMainLicenseComponent()
    SfBaseComponent.LicenseContext
    SfBaseComponent.OnObservableChange(string, object, bool, NotifyCollectionChangedEventArgs)
    SfBaseComponent.ValidateLicense()
    SfDataBoundComponent.DataManager
    SfDataBoundComponent.MainParent
    SfDataBoundComponent.OnAfterRenderAsync(bool)
    SfDataBoundComponent.OnInitializedAsync()
    SfDataBoundComponent.OnParametersSetAsync()
    SfDataBoundComponent.SetDataManager<T>(object)
    SfDropDownBase<TItem>.ActionCompleteAsync(IEnumerable<TItem>, Query)
    SfDropDownBase<TItem>.ActionFailureAsync(object)
    SfDropDownBase<TItem>.ActionFailureTemplate
    SfDropDownBase<TItem>.AddItemsAsync(IEnumerable<TItem>, int?)
    SfDropDownBase<TItem>.CheckSanitizer(string)
    SfDropDownBase<TItem>.CloneQuery(Query)
    SfDropDownBase<TItem>.DataProcessAsync(VirtualAction, bool)
    SfDropDownBase<TItem>.DataSource
    SfDropDownBase<TItem>.DisableListItem(ListOptions<TItem>)
    SfDropDownBase<TItem>.Dispose(bool)
    SfDropDownBase<TItem>.DropDownsEditContext
    SfDropDownBase<TItem>.DuplicateQuery
    SfDropDownBase<TItem>.ExecuteSimpleQuery(IEnumerable<TItem>, Query, bool)
    SfDropDownBase<TItem>.FilterDataSource
    SfDropDownBase<TItem>.FilterQuery
    SfDropDownBase<TItem>.FilterType
    SfDropDownBase<TItem>.GenerateAndExecuteQueryAsync(Query, int, int)
    SfDropDownBase<TItem>.GeneratedData
    SfDropDownBase<TItem>.GetDataSourceAsync(IEnumerable<TItem>, Query)
    SfDropDownBase<TItem>.GetGroupedDataSourceAsync(IEnumerable<TItem>, SortOrder)
    SfDropDownBase<TItem>.GetSkeletonCount(bool)
    SfDropDownBase<TItem>.GroupTemplate
    SfDropDownBase<TItem>.IgnoreAccent
    SfDropDownBase<TItem>.IgnoreCase
    SfDropDownBase<TItem>.IncrementalEndIndex
    SfDropDownBase<TItem>.IncrementalSearchIndex
    SfDropDownBase<TItem>.IncrementalStartIndex
    SfDropDownBase<TItem>.InsertItemAsync(IEnumerable<TItem>, int?, bool)
    SfDropDownBase<TItem>.IsCustomFilteringAction
    SfDropDownBase<TItem>.IsDisable(TItem)
    SfDropDownBase<TItem>.IsEntireDataUpdated
    SfDropDownBase<TItem>.IsExecuteQueryCalled
    SfDropDownBase<TItem>.IsFilterMode()
    SfDropDownBase<TItem>.IsMultiSelect
    SfDropDownBase<TItem>.IsPrimitiveDataType()
    SfDropDownBase<TItem>.IsReOrderData
    SfDropDownBase<TItem>.IsVirtualization(bool, bool, bool, bool)
    SfDropDownBase<TItem>.IsVirtualizationEnabled
    SfDropDownBase<TItem>.IsVirtualSelectAll
    SfDropDownBase<TItem>.ItemTemplate
    SfDropDownBase<TItem>.JsRuntime
    SfDropDownBase<TItem>.ListHeight
    SfDropDownBase<TItem>.ListItemCreated(ListOptions<TItem>)
    SfDropDownBase<TItem>.ListItemsCount
    SfDropDownBase<TItem>.ListVirtualData
    SfDropDownBase<TItem>.NoRecordsTemplate
    SfDropDownBase<TItem>.PreviousFocusData
    SfDropDownBase<TItem>.Query
    SfDropDownBase<TItem>.reflectionHelper
    SfDropDownBase<TItem>.ReOrderData
    SfDropDownBase<TItem>.ScrollActions
    SfDropDownBase<TItem>.SelectedValueAction
    SfDropDownBase<TItem>.SetCurrentViewDataAsync(int, int)
    SfDropDownBase<TItem>.SetFields()
    SfDropDownBase<TItem>.SetItemValue(string, Type)
    SfDropDownBase<TItem>.SortOrder
    SfDropDownBase<TItem>.VirtualCustomData
    SfDropDownBase<TItem>.VirtualGroupDataSource
    SfDropDownBase<TItem>.VirtualItemEndIndex
    SfDropDownBase<TItem>.VirtualItemStartIndex
    SfDropDownBase<TItem>.VirtualListHeight
    SfDropDownBase<TItem>.VirtualSelectAllDataSource
    SfDropDownBase<TItem>.ZIndex
    SfDropDownList<TValue, TItem>.AllowFiltering
    SfDropDownList<TValue, TItem>.AllowResize
    SfDropDownList<TValue, TItem>.ASSERTIVE
    SfDropDownList<TValue, TItem>.BOTH
    SfDropDownList<TValue, TItem>.BuildRenderTree(RenderTreeBuilder)
    SfDropDownList<TValue, TItem>.ClearAllAsync(EventArgs, bool)
    SfDropDownList<TValue, TItem>.ClearAsync()
    SfDropDownList<TValue, TItem>.ComponentName
    SfDropDownList<TValue, TItem>.ContainerElementAttribute
    SfDropDownList<TValue, TItem>.ContainerElementClass
    SfDropDownList<TValue, TItem>.CssClass
    SfDropDownList<TValue, TItem>.DebounceDelay
    SfDropDownList<TValue, TItem>.DisableItem(int)
    SfDropDownList<TValue, TItem>.DisableItem(TValue)
    SfDropDownList<TValue, TItem>.DropDownClickHandlerAsync()
    SfDropDownList<TValue, TItem>.DropdownIcon
    SfDropDownList<TValue, TItem>.Enabled
    SfDropDownList<TValue, TItem>.EnablePersistence
    SfDropDownList<TValue, TItem>.EnableRtl
    SfDropDownList<TValue, TItem>.EnableVirtualization
    SfDropDownList<TValue, TItem>.FALSE
    SfDropDownList<TValue, TItem>.FilterAsync(IEnumerable<TItem>, Query, FieldSettingsModel)
    SfDropDownList<TValue, TItem>.FilterBarPlaceholder
    SfDropDownList<TValue, TItem>.FilterInputKeyUpHandlerAync(KeyboardEventArgs)
    SfDropDownList<TValue, TItem>.FilterInputObject
    SfDropDownList<TValue, TItem>.FloatLabelType
    SfDropDownList<TValue, TItem>.FocusAsync()
    SfDropDownList<TValue, TItem>.FocusedListData
    SfDropDownList<TValue, TItem>.FocusOutAsync()
    SfDropDownList<TValue, TItem>.FocusOutHandlerAsync(FocusEventArgs, bool)
    SfDropDownList<TValue, TItem>.FooterTemplate
    SfDropDownList<TValue, TItem>.GetDataByValue(TValue)
    SfDropDownList<TValue, TItem>.GetItemsAsync()
    SfDropDownList<TValue, TItem>.HeaderTemplate
    SfDropDownList<TValue, TItem>.HidePopupAsync()
    SfDropDownList<TValue, TItem>.HideSpinnerAsync()
    SfDropDownList<TValue, TItem>.HtmlAttributes
    SfDropDownList<TValue, TItem>.ID
    SfDropDownList<TValue, TItem>.IncrementalListData
    SfDropDownList<TValue, TItem>.Index
    SfDropDownList<TValue, TItem>.IndexChanged
    SfDropDownList<TValue, TItem>.InputAttributes
    SfDropDownList<TValue, TItem>.InputBaseObject
    SfDropDownList<TValue, TItem>.IsAutoComplete
    SfDropDownList<TValue, TItem>.IsBeforePopupOpen
    SfDropDownList<TValue, TItem>.IsComboBox
    SfDropDownList<TValue, TItem>.IsCustomValue()
    SfDropDownList<TValue, TItem>.IsDropDownList
    SfDropDownList<TValue, TItem>.IsFocusing
    SfDropDownList<TValue, TItem>.IsIncrementalRequest
    SfDropDownList<TValue, TItem>.IsPopupFirstRender
    SfDropDownList<TValue, TItem>.IsPopupShown
    SfDropDownList<TValue, TItem>.IsTabKeyAction
    SfDropDownList<TValue, TItem>.KeyAction
    SfDropDownList<TValue, TItem>.NO_DATA
    SfDropDownList<TValue, TItem>.NoDataContent
    SfDropDownList<TValue, TItem>.Placeholder
    SfDropDownList<TValue, TItem>.PopupContent
    SfDropDownList<TValue, TItem>.PopupDisplayMode
    SfDropDownList<TValue, TItem>.PopupHeight
    SfDropDownList<TValue, TItem>.PopupWidth
    SfDropDownList<TValue, TItem>.PreventAutoFillAction
    SfDropDownList<TValue, TItem>.PreventIconHandler
    SfDropDownList<TValue, TItem>.PreviousItemData
    SfDropDownList<TValue, TItem>.PreviousValue
    SfDropDownList<TValue, TItem>.Readonly
    SfDropDownList<TValue, TItem>.RefreshDataAsync()
    SfDropDownList<TValue, TItem>.RootElementClass
    SfDropDownList<TValue, TItem>.ROOTNODECLASS
    SfDropDownList<TValue, TItem>.SearchListAsync(KeyboardEventArgs, bool)
    SfDropDownList<TValue, TItem>.SetCurrentViewDataAsync(int, int)
    SfDropDownList<TValue, TItem>.ShowClearButton
    SfDropDownList<TValue, TItem>.ShowPopupAsync()
    SfDropDownList<TValue, TItem>.ShowSpinnerAsync()
    SfDropDownList<TValue, TItem>.TabIndex
    SfDropDownList<TValue, TItem>.TokenSource
    SfDropDownList<TValue, TItem>.TRUE
    SfDropDownList<TValue, TItem>.TypedString
    SfDropDownList<TValue, TItem>.UpdateDisableItem(TItem)
    SfDropDownList<TValue, TItem>.UpdateIncrementalInfo(int, int, bool)
    SfDropDownList<TValue, TItem>.UpdateIncrementalItemIndex(int, int)
    SfDropDownList<TValue, TItem>.UpdateMainData()
    SfDropDownList<TValue, TItem>.UpdateValueAsync()
    SfDropDownList<TValue, TItem>.Value
    SfDropDownList<TValue, TItem>.ValueChanged
    SfDropDownList<TValue, TItem>.ValueExpression
    SfDropDownList<TValue, TItem>.ValueTemplate
    SfDropDownList<TValue, TItem>.Width
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfComboBox<TValue, TItem> : SfDropDownList<TValue, TItem>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Type Parameters
    Name Description
    TValue

    The type of the value selected or entered in the ComboBox.

    TItem

    The type of items displayed in the ComboBox dropdown list.

    Remarks

    The ComboBox extends DropDownList and provides additional features such as custom value input, autofill, and filtering capabilities. Use TValue for the value type and TItem for the data type of items in the dropdown list.

    Examples
    <SfComboBox TValue="string" TItem="string" DataSource="@MyList" AllowCustom="true" Autofill="true">
        <ComboBoxEvents TValue="string" TItem="string" ValueChange="@OnValueChange" />
    </SfComboBox>
    @code {
        protected List<string> MyList = new List<string> { "Apple", "Banana", "Orange" };
        private void OnValueChange(ChangeEventArgs<string, string> args)
        {
            // Handle value change
        }
    }

    Constructors

    SfComboBox()

    Declaration
    public SfComboBox()

    Properties

    AllowCustom

    Gets or sets a value indicating whether the ComboBox allows users to enter custom values not present in the data source.

    Declaration
    [Parameter]
    public bool AllowCustom { get; set; }
    Property Value
    Type Description
    bool

    A boolean where true allows users to enter custom values; otherwise, false. The default value is true.

    Remarks

    When set to true, users can type a value that does not exist in the data source, and the CustomValueSpecifier event is triggered to handle the custom value. If set to false, only predefined values from the data source can be selected.

    Examples
    <SfComboBox TValue="string" TItem="string" AllowCustom="true" DataSource="@MyList">
        <ComboBoxEvents TValue="string" TItem="string" CustomValueSpecifier="@OnCustomValue" />
    </SfComboBox>
    @code {
        protected List<string> MyList = new List<string> { "Apple", "Banana", "Orange" };
        private void OnCustomValue(CustomValueSpecifierEventArgs<string> args)
        {
            args.Item = args.Text;
        }
    }

    Autofill

    Gets or sets a value indicating whether the ComboBox automatically fills the input with the first matched item while typing.

    Declaration
    [Parameter]
    public bool Autofill { get; set; }
    Property Value
    Type Description
    bool

    A boolean where true enables autofill functionality; otherwise, false. The default value is false.

    Remarks

    When set to true, the ComboBox automatically completes the input with the first matching item from the data source as the user types. This enhances the user experience by suggesting relevant options dynamically.

    Examples
    <SfComboBox TValue="string" TItem="string" Autofill="true" DataSource="@MyList" />
    @code {
        protected List<string> MyList = new List<string> { "Apple", "Banana", "Orange" };
    }

    IsClearButtonStopPropagation

    Declaration
    protected bool IsClearButtonStopPropagation { get; set; }
    Property Value
    Type
    bool

    ShowClearButton

    Gets or sets a value indicating whether the ComboBox displays a clear button to reset the selected value.

    Declaration
    [Parameter]
    public override bool ShowClearButton { get; set; }
    Property Value
    Type Description
    bool

    A boolean where true displays the clear button; otherwise, false. The default value is true.

    Overrides
    SfDropDownList<TValue, TItem>.ShowClearButton
    Remarks

    When the clear button is clicked, the Value and Index properties are reset to null, allowing users to easily clear the current selection and start anew. This feature enhances usability by providing a quick way to reset the input.

    Examples
    <SfComboBox TValue="string" TItem="string" ShowClearButton="true" DataSource="@MyList" />
    @code {
        protected List<string> MyList = new List<string> { "Apple", "Banana", "Orange" };
    }

    ValidateOnInput

    Gets or sets a value indicating whether the ComboBox performs validation on input changes.

    Declaration
    [Parameter]
    public bool ValidateOnInput { get; set; }
    Property Value
    Type Description
    bool

    A boolean where true enables validation on input; otherwise, false. The default value is false.

    Remarks

    When set to true, the ComboBox validates the input as the user types and updates the model value. The ValueChange event is triggered after the component loses focus, allowing for form validation or further processing of the input value.

    Examples
    <SfComboBox TValue="string" TItem="string" ValidateOnInput="true" DataSource="@MyList">
        <ComboBoxEvents TValue="string" TItem="string" ValueChange="@OnValueChange" />
    </SfComboBox>
    @code {
        protected List<string> MyList = new List<string> { "Apple", "Banana", "Orange" };
        private void OnValueChange(ChangeEventArgs<string, string> args)
        {
            // Handle value change
        }
    }

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    SfDropDownList<TValue, TItem>.BuildRenderTree(RenderTreeBuilder)

    IsCustomValue()

    Declaration
    protected override bool IsCustomValue()
    Returns
    Type
    bool
    Overrides
    SfDropDownList<TValue, TItem>.IsCustomValue()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved