menu

Blazor

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

    Show / Hide Table of Contents

    Class ComboBoxFieldSettings

    Represents the field mappings for binding data table columns to the ComboBox component.

    Inheritance
    System.Object
    SfBaseComponent
    SfDataBoundComponent
    ComboBoxFieldSettings
    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.OnInitializedAsync()
    SfDataBoundComponent.OnParametersSetAsync()
    SfDataBoundComponent.SetDataManager<T>(Object)
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ComboBoxFieldSettings : SfDataBoundComponent

    Constructors

    ComboBoxFieldSettings()

    Declaration
    public ComboBoxFieldSettings()

    Properties

    Disabled

    Gets or sets the field name indicating whether a list item is disabled.

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

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

    Remarks

    This property maps a data source field to a boolean value that indicates whether a specific item in the ComboBox is disabled. If set to true for an item, that item cannot be selected in the popup.

    Examples
    <SfComboBox TValue="int" TItem="Item" DataSource="@Items">
        <ComboBoxFieldSettings Text="Name" Value="Id" Disabled="IsDisabled" />
    </SfComboBox>
    @code {
        public class Item
        {
            public string Name { get; set; }
            public int Id { get; set; }
            public bool IsDisabled { get; set; }
        }
        private List<Item> Items = new List<Item>
        {
            new Item { Name = "Item1", Id = 1, IsDisabled = false },
            new Item { Name = "Item2", Id = 2, IsDisabled = true }
        };
    }

    GroupBy

    Gets or sets the field name used to group ComboBox items.

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

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

    Remarks

    This property specifies the data source field used to categorize items into groups within the ComboBox popup. When set, items are organized under group headers based on this field.

    Examples
    <SfComboBox TValue="int" TItem="Country" DataSource="@Countries">
        <ComboBoxFieldSettings GroupBy="Continent" Text="Name" Value="Code" />
    </SfComboBox>
    @code {
        public class Country
        {
            public string Continent { get; set; }
            public string Name { get; set; }
            public int Code { get; set; }
        }
        private List<Country> Countries = new List<Country>
        {
            new Country { Continent = "Asia", Name = "China", Code = 1 },
            new Country { Continent = "Asia", Name = "Japan", Code = 2 },
            new Country { Continent = "Europe", Name = "France", Code = 3 }
        };
    }

    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 field name used as the CSS class for the icon displayed for each list item in the ComboBox popup.

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

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

    Remarks

    This property maps a data source field to the CSS class used for displaying icons next to list items in the ComboBox popup, enhancing visual representation of items.

    Examples
    <SfComboBox TValue="int" TItem="Item" DataSource="@Items">
        <ComboBoxFieldSettings IconCss="IconClass" Text="Name" Value="Id" />
    </SfComboBox>
    @code {
        public class Item
        {
            public string IconClass { get; set; }
            public string Name { get; set; }
            public int Id { get; set; }
        }
        private List<Item> Items = new List<Item>
        {
            new Item { IconClass = "e-icon-check", Name = "Item1", Id = 1 },
            new Item { IconClass = "e-icon-star", Name = "Item2", Id = 2 }
        };
    }

    Text

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

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

    A string representing the field name used for the display text of each list item. The default value is null.

    Remarks

    This property maps a data source field to the text displayed for each item in the ComboBox popup, determining what the user sees in the dropdown list.

    Examples
    <SfComboBox TValue="int" TItem="Item" DataSource="@Items">
        <ComboBoxFieldSettings Text="Name" Value="Id" />
    </SfComboBox>
    @code {
        public class Item
        {
            public string Name { get; set; }
            public int Id { get; set; }
        }
        private List<Item> Items = new List<Item>
        {
            new Item { Name = "Item1", Id = 1 },
            new Item { Name = "Item2", Id = 2 }
        };
    }

    Value

    Gets or sets the field name used as the value for each list item in the ComboBox popup.

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

    A string representing the field name used as the value for each list item. The default value is null.

    Remarks

    This property maps a data source field to the value associated with each item in the ComboBox popup, which is used when selecting an item.

    Examples
    <SfComboBox TValue="int" TItem="Item" DataSource="@Items">
        <ComboBoxFieldSettings Text="Name" Value="Id" />
    </SfComboBox>
    @code {
        public class Item
        {
            public string Name { get; set; }
            public int Id { get; set; }
        }
        private List<Item> Items = new List<Item>
        {
            new Item { Name = "Item1", Id = 1 },
            new Item { Name = "Item2", Id = 2 }
        };
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved