Server Side Events

The following are the server side events available in the DropDownList control.

Event Event Description Event Description
OnCheckChange Occurs when CheckBox value is change. Event Argument contains the following parameters,
  • e.IsChecked – Status of the DropDownList Checkbox.
  • e.Text – Text of the DropDownList Selected list.
  • e.Value – Value of the DropDownList Selected list.
  • e.SelectedText – Selected Node Text of the DropDownList Selected list.
  • e.ItemId – Index Value of the DropDownList Selected list.
  • e.EventType – Event Name.
  • e.Arguments – Contain keys and values for IsChecked, Text, Value, SelectedText and ItemId.
OnValueSelect Occurs when DropDownList Active list changes. Event Argument contains the following parameters,
  • e.IsChecked – Status of DropDownList Checkbox.
  • e.Text – Text of the DropDownList Selected list.
  • e.Value – Value of the DropDownList Selected list.
  • e.SelectedText – Selected Node Text of the DropDownList Selected list.
  • e.ItemId – Index Value of the DropDownList Selected list.
  • e.EventType – Event Name.Arguments – Contain keys and values for IsChecked, Text, Value, SelectedText and ItemId.

In the ASPX page, add the DropDownList control to configure the DropDownList events.

  • html
  • <ej:DropDownList ID="dropdownlist" TargetID="list" Width="200px" OnValueSelect="dropdownlist_ValueSelect" ShowCheckbox="true" OnCheckedChange="dropdownlist_CheckedChange" runat="server" OnCascade="dropdownlist_Cascade" OnSearch="dropdownlist_Search" >
    
        </ej:DropDownList>
    
        <div id="list">
    
            <ul>
    
                <li>Art</li>
    
                <li>Architecture</li>
    
                <li>Biography</li>
    
                <li>Comics</li>
    
                <li>Sports</li>
    
                <li>Science</li>
    
            </ul>
    
        </div>

    The code Define dropdownlist ValueSelect server side event in behind.

  • c#
  • protected void dropdownlist_ValueSelect(object sender, Syncfusion.JavaScript.Web.DropdownListEventArgs e)
    
        {
    
    
            //e.EventType – Event Name
    
            //e.Arguments – Contain keys and values for IsChecked,Text,Value,SelectedText and ItemId
    
            //e.Text – Text value of selected node
    
            //e.Value – Value of selected node
    
            //e.SelectedText – Text  of selected node
    
            //e.ItemId – Index value of selected node
    
        }
    	
    	protected void dropdownlist_CheckedChange(object sender, Syncfusion.JavaScript.Web.DropdownListEventArgs e)
    	{
    	    //e.IsChecked – Status of Checkbox
    	}
    
    	protected void dropdownlist_Cascade(object sender, Syncfusion.JavaScript.Web.DropdownListEventArgs e)
    	{
            //e.CascadeValue - Get the cascaded DropDownList value
    	}
    
    	protected void dropdownlist_Search(object sender, Syncfusion.JavaScript.Web.DropdownListEventArgs e)
    	{
            // e.SearchString - Entered search string in textbox
            // e.SearchedListItems - Get the list of items searched
    	}