menu

Blazor

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

    Show / Hide Table of Contents

    Class DropDownListFieldSettings

    A class that represents the Dropdown list fields to map with the data source and binds the data to the component.

    Inheritance
    System.Object
    SfBaseComponent
    SfDataBoundComponent
    DropDownListFieldSettings
    Inherited Members
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(Boolean)
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)
    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 DropDownListFieldSettings : SfDataBoundComponent
    Examples
    <SfDropDownList TValue="string" TItem="Country" Placeholder="Select a country" DataSource="@Countries">
        <DropDownListFieldSettings Text="Name" Value="Code"/>
    </SfDropDownList>
    @code{
        public class Country
        {
            public string Name { get; set; }
            public string Code { get; set; }
        }
        List<Country> Countries = new List<Country> {
            new Country() { Name = "Australia", Code = "AU" },
            new Country() { Name = "Bermuda", Code = "BM" },
            new Country() { Name = "Canada", Code = "CA" }
        };
    }

    Constructors

    DropDownListFieldSettings()

    Declaration
    public DropDownListFieldSettings()

    Properties

    Disabled

    Defines whether the particular field value is disabled or not.

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

    true if the field value is disabled; otherwise, false.

    Remarks

    This property specifies whether the particular field value in the drop-down-list is disabled or not.
    If set to true, the field value will be disabled; otherwise, it will be enabled.

    GroupBy

    Gets or sets filed names to display the list in category-wise.

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

    Accepts a string value. The default value is String.Empty.

    Examples
    <SfDropDownList TValue="string" TItem="Vegetables" Placeholder="Select a country" DataSource="@VegetablesList">
        <DropDownListFieldSettings Text="Name" Value="ID" GroupBy="Category" />
    </SfDropDownList>
    @code{
        public class Vegetables
        {
            public string ID { get; set; }
            public string Name { get; set; }
            public string Category { get; set; }
        }
        List<Vegetables> VegetablesList = new List<Vegetables> {
            new Vegetables { Name = "Cabbage", Category = "Leafy and Salad", ID = "item1" },
            new Vegetables { Name = "Chickpea", Category = "Beans", ID = "item2" },
            new Vegetables { Name = "Green bean", Category = "Beans", ID = "item4" },
            new Vegetables { Name = "Spinach", Category = "Leafy and Salad", ID = "item9" }
        };
    }

    HtmlAttributes

    Gets or sets a collection of additional attributes such as styles, classes, and more that will be applied to the pop-up list element.

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

    The value as dictionary collection.The default value is null

    Remarks

    If you configured both property and equivalent html attributes, then the component considers the property value.

    IconCss

    Gets or sets a CSS class string to include an icon or image for the dropdown list item.

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

    Accepts a CSS class string separated by space to include an icon or image for the dropdown list item. The default value is String.Empty.

    Text

    Gets or sets the text that maps the text field from the data source model for each list item.

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

    Accepts a string value. The default value is String.Empty.

    Remarks

    If not mapped, the text field in the drop-down list item show as an empty text for each list item.

    Value

    Gets or sets the value that maps the value field from the data source for each list item.

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

    Accepts a string value. The default value is String.Empty.

    Remarks

    If not mapped the text filed in the dropdown list item show as empty popup.

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