menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class AutoCompleteFieldSettings - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class AutoCompleteFieldSettings

    Represents the field mappings for binding data table columns to the SfAutoComplete<TValue, TItem> component.

    Inheritance
    System.Object
    SfBaseComponent
    SfDataBoundComponent
    AutoCompleteFieldSettings
    Inherited Members
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(Boolean)
    SfBaseComponent.GetEffectivePlatform()
    SfBaseComponent.GetMainComponentPlatform()
    SfBaseComponent.IsMainLicenseComponent()
    SfBaseComponent.LicenseContext
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)
    SfBaseComponent.ValidateLicense()
    SfDataBoundComponent.DataManager
    SfDataBoundComponent.MainParent
    SfDataBoundComponent.OnAfterRenderAsync(Boolean)
    SfDataBoundComponent.OnParametersSetAsync()
    SfDataBoundComponent.SetDataManager<T>(Object)
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class AutoCompleteFieldSettings : SfDataBoundComponent

    Constructors

    AutoCompleteFieldSettings()

    Declaration
    public AutoCompleteFieldSettings()

    Properties

    Disabled

    Gets or sets the field name indicating whether a particular item in the SfAutoComplete<TValue, TItem> is disabled.

    Declaration
    public string Disabled { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the field name that determines if an item is disabled. The default value is null.

    Remarks

    This property specifies a field in the data source that indicates whether an item in the suggestion list is disabled, preventing it from being selected.

    Examples
    <SfAutoComplete TItem="MyItem" TValue="string" DataSource="@MyList">
        <AutoCompleteFieldSettings Disabled="IsDisabled"/>
    </SfAutoComplete>
    @code {
        public class MyItem { public string Value { get; set; } public bool IsDisabled { get; set; } }
        protected List<MyItem> MyList = new List<MyItem>();
    }

    GroupBy

    Gets or sets the field name used to group the SfAutoComplete<TValue, TItem> items.

    Declaration
    public string GroupBy { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the name of the field used for grouping items. The default value is null.

    Remarks

    This property enables grouping of items in the suggestion list based on the specified field, improving the organization of the dropdown content.

    Examples
    <SfAutoComplete TItem="MyItem" TValue="string" DataSource="@MyList">
        <AutoCompleteFieldSettings GroupBy="Category"/>
    </SfAutoComplete>
    @code {
        public class MyItem { public string Value { get; set; } public string Category { get; set; } }
        protected List<MyItem> MyList = new List<MyItem>();
    }

    HtmlAttributes

    You can add the additional html attributes such as styles, class, and more to the list element. If you configured both property and equivalent html attributes, then the component considers the property value.

    Declaration
    public string HtmlAttributes { get; set; }
    Property Value
    Type
    System.String

    IconCss

    Gets or sets the CSS class name used for the icon displayed for each list item in the suggestion popup.

    Declaration
    public string IconCss { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the CSS class name for the icon. The default value is null.

    Remarks

    This property allows customization of the visual appearance of list items by associating an icon with each item in the suggestion popup.

    Examples
    <SfAutoComplete TItem="MyItem" TValue="string" DataSource="@MyList">
        <AutoCompleteFieldSettings IconCss="Icon"/>
    </SfAutoComplete>
    @code {
        public class MyItem { public string Value { get; set; } public string Icon { get; set; } }
        protected List<MyItem> MyList = new List<MyItem>();
    }

    Text

    Gets or sets the column name used as the display text for each list item in the suggestion popup.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the column name used for the display text. The default value is null.

    Remarks

    This property specifies the field from the data source used as the display text for each item in the suggestion list of the SfAutoComplete<TValue, TItem> component. Note that the SfAutoComplete<TValue, TItem> uses the Value field for all internal operations, such as filtering and selection. The Text field is solely for displaying text in the popup. If mapping a single field, it is recommended to use the Value field to ensure proper filtering and selection behavior. To customize the filtering behavior, refer to the custom filtering documentation: https://blazor.syncfusion.com/documentation/autocomplete/filtering#custom-filtering.

    Examples
    <SfAutoComplete TItem="MyItem" TValue="string" DataSource="@MyList">
        <AutoCompleteFieldSettings Text="Name"/>
    </SfAutoComplete>
    @code {
        public class MyItem { public string Value { get; set; } public string Name { get; set; } }
        protected List<MyItem> MyList = new List<MyItem>();
    }

    Value

    Gets or sets the column name used as the value for each list item in the suggestion popup.

    Declaration
    public string Value { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the column name used for the item value. The default value is null.

    Remarks

    This property specifies which field from the data source is used as the value for each item in the suggestion list, typically used for selection handling.

    Examples
    <SfAutoComplete TItem="MyItem" TValue="string" DataSource="@MyList">
        <AutoCompleteFieldSettings Value="Id"/>
    </SfAutoComplete>
    @code {
        public class MyItem { public string Id { get; set; } public string Name { get; set; } }
        protected List<MyItem> MyList = new List<MyItem>();
    }

    Methods

    OnInitializedAsync()

    Triggers during the initial rendering of the AutoCompleteFieldSettings component.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous initialization operation.

    Overrides
    SfDataBoundComponent.OnInitializedAsync()
    Remarks

    This method is called when the component is first initialized, updating the parent component with the field settings and triggering a state update.

    Exceptions
    Type Condition
    System.Exception

    Thrown if an error occurs during initialization.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved