menu

ASP.NET MVC

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DropDownList

    Show / Hide Table of Contents

    Class DropDownList

    Represents the DropDownList UI element.

    Inheritance
    System.Object
    CommonDataBoundControl
    DropDownList
    Implements
    System.Web.UI.INamingContainer
    System.Web.UI.IPostBackEventHandler
    System.Web.UI.IPostBackDataHandler
    System.Web.UI.IUrlResolutionService
    Inherited Members
    CommonDataBoundControl.PerformDataBinding(IEnumerable)
    CommonDataBoundControl.RaisePostBackEvent(String)
    CommonDataBoundControl.OnLoad(EventArgs)
    CommonDataBoundControl.OnPreRender(EventArgs)
    CommonDataBoundControl.RenderContents(HtmlTextWriter)
    Namespace: Syncfusion.JavaScript.Web
    Assembly: Syncfusion.EJ.Web.dll
    Syntax
    public class DropDownList : CommonDataBoundControl, INamingContainer, IPostBackEventHandler, IPostBackDataHandler, IUrlResolutionService

    Constructors

    DropDownList()

    Declaration
    public DropDownList()

    Properties

    ActionFailure

    Occurs when the action failure.

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

    The action failure.

    ActionSuccess

    Occurs when the action success.

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

    The action success.

    AllowGrouping

    Gets or sets a value indicating whether [allow grouping].

    Declaration
    [Obsolete("AllowGrouping has been deprecated, binding GroupBy field will automatically enable grouping ")]
    public bool AllowGrouping { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [allow grouping]; otherwise, false.

    AllowVirtualScrolling

    Gets or sets a value indicating whether [allow virtual scrolling].

    Declaration
    public bool AllowVirtualScrolling { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [allow virtual scrolling]; otherwise, false.

    CascadeTo

    Gets or sets the cascade to.

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

    The cascade to.

    CaseSensitiveSearch

    Gets or sets a value indicating whether [case sensitive search].

    Declaration
    public bool CaseSensitiveSearch { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [case sensitive search]; otherwise, false.

    CheckAll

    Gets or sets a value indicating whether [check all].

    Declaration
    [Obsolete("CheckAll has been deprecated, use API method ")]
    public bool CheckAll { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [check all]; otherwise, false.

    ClientSideOnActionBegin

    Occurs when the client side on action begin.

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

    The client side on action begin.

    ClientSideOnActionComplete

    Occurs when the client side on action complete.

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

    The client side on action complete.

    ClientSideOnBeforePopupHide

    Gets or sets the client side on before popup hide.

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

    The client side on before popup hide.

    ClientSideOnBeforePopupShown

    Occurs before the popup is ready to be displayed.

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

    The client side on before popup shown.

    ClientSideOnCascade

    Occurs when the cascading happens between two DropDownList exactly after the value changes in the first dropdown and before filtering in the second Dropdown.

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

    The client side on cascade.

    ClientSideOnChange

    Occurs when the list item checkbox value is changed.

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

    The client side on change.

    ClientSideOnCheckChange

    Gets or sets the client side on check change.

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

    The client side on check change.

    ClientSideOnCreate

    Occurs when client side on create.

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

    The client side on create.

    ClientSideOnDataBound

    Occurs when the list items is bound to the DropDownList.

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

    The client side on data bound.

    ClientSideOnDestroy

    Occurs the action when the DropDownList is destroyed.

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

    The client side on destroy.

    ClientSideOnFocusIn

    Fires the action when the DropDownList is focused.

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

    The client side on FocusIn DropDownList

    ClientSideOnFocusOut

    Fires the action when the DropDownList is about to lose focus.

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

    The client side on FocusOut DropDownList.

    ClientSideOnPopupHide

    Occurs when the popup is closed.

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

    The client side on popup hide.

    ClientSideOnPopupResize

    Occurs when the popup is resized.

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

    The client side on popup resize.

    ClientSideOnPopupResizeStart

    Occurs when resizing a popup starts.

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

    The client side on popup resize start.

    ClientSideOnPopupResizeStop

    Occurs when the popup resizing is stopped.

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

    The client side on popup resize stop.

    ClientSideOnPopupShown

    Occurs when the popup is opened.

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

    The client side on popup shown.

    ClientSideOnSearch

    Occurs before filtering the list items that starts in the DropDownList when the enableFilterSearch is enabled.

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

    The client side on search.

    ClientSideOnSelect

    Occurs when the list of item is selected.

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

    The client side on select.

    CssClass

    Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client.

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

    The CSS class.

    DataGroupByField

    Gets or sets the data group by field.

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

    The data group by field.

    DataHtmlAttributesField

    Gets or sets the data HTML attributes field.

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

    The data HTML attributes field.

    DataIdField

    Gets or sets the data identifier field.

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

    The data identifier field.

    DataImageAttributesField

    Gets or sets the data image attributes field.

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

    The data image attributes field.

    DataImageUrlField

    Gets or sets the data image URL field.

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

    The data image URL field.

    DataManager

    Data Manager as Inner property, which help us to bind the data sources from data adaptors

    Declaration
    public DataSource DataManager { get; set; }
    Property Value
    Type Description
    DataSource

    DataSelectedField

    Gets or sets the data selected field.

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

    The data selected field.

    DataSource

    Gets or sets the object from which the data-bound control retrieves its list of data items.

    Declaration
    public object DataSource { get; set; }
    Property Value
    Type Description
    System.Object

    The data source.

    DataSourceCachingMode

    Gets or sets the data source caching mode.

    Declaration
    public DataSourceCachingMode DataSourceCachingMode { get; set; }
    Property Value
    Type Description
    DataSourceCachingMode

    The data source caching mode.

    DataSpriteCSSField

    Gets or sets the data sprite CSS field.

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

    The data sprite CSS field.

    DataTableNameField

    Gets or sets the data table name field.

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

    The data table name field.

    DataTextField

    Gets or sets the data text field.

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

    The data text field.

    DataValueField

    Gets or sets the data value field.

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

    The data value field.

    DelimiterChar

    Gets or sets the delimiter character.

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

    The delimiter character.

    DisableItemsByIndex

    Gets or sets the index of the disable items by.

    Declaration
    [Obsolete("DisableItemsByIndex has been deprecated, use API method ")]
    public string DisableItemsByIndex { get; set; }
    Property Value
    Type Description
    System.String

    The index of the disable items by.

    DropDownListFields

    Gets the drop down list fields.

    Declaration
    public DropDownListFields DropDownListFields { get; }
    Property Value
    Type Description
    DropDownListFields

    The drop down list fields.

    EnableAnimation

    Gets or sets a value indicating whether [enable animation].

    Declaration
    public bool EnableAnimation { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable animation]; otherwise, false.

    Enabled

    Gets or sets a value indicating whether the Web server control is enabled.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enabled; otherwise, false.

    EnableFilterSearch

    Gets or sets a value indicating whether [enable filter search].

    Declaration
    public bool EnableFilterSearch { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable filter search]; otherwise, false.

    EnableIncrementalSearch

    Gets or sets a value indicating whether [enable incremental search].

    Declaration
    public bool EnableIncrementalSearch { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable incremental search]; otherwise, false.

    EnableItemsByIndex

    Gets or sets the index of the enable items by.

    Declaration
    [Obsolete("EnableItemsByIndex has been deprecated, use API method ")]
    public string EnableItemsByIndex { get; set; }
    Property Value
    Type Description
    System.String

    The index of the enable items by.

    EnablePersistence

    Gets or sets a value indicating whether [enable persistence].

    Declaration
    public bool EnablePersistence { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable persistence]; otherwise, false.

    EnablePopupResize

    Gets or sets a value indicating whether [enable popup resize].

    Declaration
    public bool EnablePopupResize { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable popup resize]; otherwise, false.

    EnableRTL

    Gets or sets a value indicating whether [enable RTL].

    Declaration
    public bool EnableRTL { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable RTL]; otherwise, false.

    EnableServerFiltering

    Gets or sets a value indicating whether [enable server filter search].

    Declaration
    public bool EnableServerFiltering { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable server filter search]; otherwise, false.

    EnableSorting

    Gets or sets a value indicating whether [enable sorting].

    Declaration
    public bool EnableSorting { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable sorting]; otherwise, false.

    FilterType

    Gets or sets the type of the filter.

    Declaration
    public SearchFilterType FilterType { get; set; }
    Property Value
    Type Description
    SearchFilterType

    The type of the filter.

    HeaderTemplate

    Gets or sets the header template.

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

    The header template.

    Height

    Gets or sets the height of the Web server control.

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

    The height.

    HtmlAttributes

    Declaration
    public IDictionary<string, object> HtmlAttributes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Object>

    Items

    Gets the items.

    Declaration
    public List<DropDownListItem> Items { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<DropDownListItem>

    The items.

    ItemsCount

    Gets or sets the items count.

    Declaration
    public int ItemsCount { get; set; }
    Property Value
    Type Description
    System.Int32

    The items count.

    ItemValue

    Gets or sets the item value.

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

    The item value.

    LoadOnDemand

    Gets or sets a value indicating whether [Load On Demand].

    Declaration
    public bool LoadOnDemand { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [Load On Demand]; otherwise, false.

    Locale

    Gets or sets the Locale template.

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

    The Locale.

    MaxPopupHeight

    Gets or sets the maximum height of the popup.

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

    The maximum height of the popup.

    MaxPopupWidth

    Gets or sets the maximum width of the popup.

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

    The maximum width of the popup.

    MinPopupHeight

    Gets or sets the minimum height of the popup.

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

    The minimum height of the popup.

    MinPopupWidth

    Gets or sets the minimum width of the popup.

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

    The minimum width of the popup.

    Model

    Gets or sets the DropDownList property to its model.

    Declaration
    public DropDownListProperties Model { get; set; }
    Property Value
    Type Description
    DropDownListProperties

    The model value

    MultiSelectMode

    Gets or sets the multi select mode.

    Declaration
    public MultiSelectModeTypes MultiSelectMode { get; set; }
    Property Value
    Type Description
    MultiSelectModeTypes

    The multi select mode.

    PopupHeight

    Gets or sets the height of the popup.

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

    The height of the popup.

    PopupWidth

    Gets or sets the width of the popup.

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

    The width of the popup.

    Query

    Gets or sets the query.

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

    The query.

    ReadOnly

    Gets or sets a value indicating whether [read only].

    Declaration
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [read only]; otherwise, false.

    SelectedIndex

    Gets or sets the index of the selected.

    Declaration
    public int SelectedIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    The index of the selected.

    SelectedIndices

    Gets or sets the selected indices.

    Declaration
    public List<int> SelectedIndices { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.Int32>

    The selected indices.

    SelectedItemIndex

    Gets or sets the index of the selected item.

    Declaration
    [Obsolete("SelectedItemIndex has been deprecated, use SelectedIndex property")]
    public int SelectedItemIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    The index of the selected item.

    SelectedItems

    Gets or sets the selected items.

    Declaration
    [Obsolete("SelectedItems has been deprecated, use SelectedIndices property")]
    public List<int> SelectedItems { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.Int32>

    The selected items.

    SelectedItemsText

    Gets the selected items text.

    Declaration
    public List<string> SelectedItemsText { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    The selected items text.

    SelectedItemsValue

    Gets the selected items value.

    Declaration
    public List<string> SelectedItemsValue { get; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    The selected items value.

    ShowCheckbox

    Gets or sets a value indicating whether [show checkbox].

    Declaration
    public bool ShowCheckbox { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [show checkbox]; otherwise, false.

    ShowPopupOnLoad

    Gets or sets a value indicating whether [show popup on load].

    Declaration
    public bool ShowPopupOnLoad { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [show popup on load]; otherwise, false.

    ShowRoundedCorner

    Gets or sets a value indicating whether [show rounded corner].

    Declaration
    public bool ShowRoundedCorner { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [show rounded corner]; otherwise, false.

    SortOrder

    Gets or sets the sort order.

    Declaration
    public SortOrder SortOrder { get; set; }
    Property Value
    Type Description
    SortOrder

    The sort order.

    TargetID

    Gets or sets the target identifier.

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

    The target identifier.

    Template

    Gets or sets the template.

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

    The template.

    Text

    Gets or sets the text.

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

    The text.

    UncheckAll

    Gets or sets a value indicating whether [uncheck all].

    Declaration
    [Obsolete("UncheckAll has been deprecated, use API method ")]
    public bool UncheckAll { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [uncheck all]; otherwise, false.

    ValidationMessage

    Gets or sets the validation message.

    Declaration
    public List<KeyValue> ValidationMessage { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<KeyValue>

    The validation message.

    ValidationMsg

    Gets or sets the validation MSG.

    Declaration
    [JsonProperty("validationMessage")]
    public Dictionary<string, object> ValidationMsg { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    The validation MSG.

    ValidationRule

    Gets or sets the validation rule.

    Declaration
    public List<KeyValue> ValidationRule { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<KeyValue>

    The validation rule.

    ValidationRules

    Gets or sets the validation rules.

    Declaration
    [JsonProperty("validationRules")]
    public Dictionary<string, object> ValidationRules { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    The validation rules.

    Value

    Gets or sets the value.

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

    The value.

    VirtualScrollMode

    Gets or sets the virtual scroll mode.

    Declaration
    public VirtualScrollMode VirtualScrollMode { get; set; }
    Property Value
    Type Description
    VirtualScrollMode

    The virtual scroll mode.

    WatermarkText

    Gets or sets the watermark text.

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

    The watermark text.

    Width

    Gets or sets the width of the Web server control.

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

    The width.

    Methods

    ClearSelection()

    Clears the selection.

    Declaration
    public void ClearSelection()

    CreateChildControls()

    Create the child controls

    Declaration
    protected override void CreateChildControls()

    DependentScripts()

    Represents the dependent scripts for DropDownList control.

    Declaration
    public List<string> DependentScripts()
    Returns
    Type Description
    System.Collections.Generic.List<System.String>

    This method returns the list of dependent script files which is of type string

    FetchData(IEnumerable)

    Fetching the data

    Declaration
    public override void FetchData(IEnumerable data)
    Parameters
    Type Name Description
    System.Collections.IEnumerable data
    Overrides
    CommonDataBoundControl.FetchData(IEnumerable)

    GetDependentFiles()

    Get the dependent files for DropDownList control

    Declaration
    public override List<string> GetDependentFiles()
    Returns
    Type Description
    System.Collections.Generic.List<System.String>
    Overrides
    CommonDataBoundControl.GetDependentFiles()

    LoadViewState(Object)

    Restores view-state information from a previous page request.

    Declaration
    protected override void LoadViewState(object state)
    Parameters
    Type Name Description
    System.Object state
    Overrides
    CommonDataBoundControl.LoadViewState(Object)

    PostBackEventHandler(String, Dictionary<String, Object>)

    Gets a value that indicates whether the page is being loaded in response to a postback.

    Declaration
    public override void PostBackEventHandler(string EventName, Dictionary<string, object> args)
    Parameters
    Type Name Description
    System.String EventName
    System.Collections.Generic.Dictionary<System.String, System.Object> args
    Overrides
    CommonDataBoundControl.PostBackEventHandler(String, Dictionary<String, Object>)

    Render()

    Render this instance

    Declaration
    public string Render()
    Returns
    Type Description
    System.String

    Render(HtmlTextWriter)

    Declaration
    protected override void Render(HtmlTextWriter writer)
    Parameters
    Type Name Description
    System.Web.UI.HtmlTextWriter writer
    Overrides
    CommonDataBoundControl.Render(HtmlTextWriter)

    SaveViewState()

    Saves any server control view-state changes that have occurred since the time the page was posted back to the server.

    Declaration
    protected override object SaveViewState()
    Returns
    Type Description
    System.Object

    UpdateServerModel(Dictionary<String, Object>)

    Maintaining viewstate model values on post back

    Declaration
    public override void UpdateServerModel(Dictionary<string, object> ClientModel)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.Object> ClientModel
    Overrides
    CommonDataBoundControl.UpdateServerModel(Dictionary<String, Object>)

    Events

    Cascade

    Occurs when [cascade].

    Declaration
    public event DropDownList.DropDownListEventHandler Cascade
    Event Type
    Type Description
    DropDownList.DropDownListEventHandler

    CheckedChange

    Occurs when [checked change].

    Declaration
    public event DropDownList.DropDownListEventHandler CheckedChange
    Event Type
    Type Description
    DropDownList.DropDownListEventHandler

    Search

    Occurs when [search].

    Declaration
    public event DropDownList.DropDownListEventHandler Search
    Event Type
    Type Description
    DropDownList.DropDownListEventHandler

    ValueSelect

    Occurs when [value select].

    Declaration
    public event DropDownList.DropDownListEventHandler ValueSelect
    Event Type
    Type Description
    DropDownList.DropDownListEventHandler

    Implements

    System.Web.UI.INamingContainer
    System.Web.UI.IPostBackEventHandler
    System.Web.UI.IPostBackDataHandler
    System.Web.UI.IUrlResolutionService

    See Also

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