Version

ItemAdded Property

Syntax
'Declaration
 
Public Property ItemAdded As String
public string ItemAdded {get; set;}
Example
WebDropDown1.ClientEvents.ItemAdded = "WebDropDown_ItemAdded"
WebDropDown1.ClientEvents.ItemAdded = "WebDropDown_ItemAdded";
// The client event 'ItemAdded' takes two parameters sender and e
// sender  is the object which is raising the event
// e is the DropDownControlEventArgs

//Fires only when items are added programmatically on the client-side
function WebDropDown_ItemAdded(sender, e) {

    //Gets the drop-down item that has mouse on it
    var item = e.get_value();

    //Gets the text of the drop-down item
   var text = item.get_text();

    //Gets the index of the drop-down item
    var index = item.get_index();

   alert("New Item '"+text+"'added at index " + index); 
          
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also