Skip to main content
A newer version of this page is available. .

ASPxClientComboBox.SelectedIndexChanged Event

Occurs on the client side after a different item in the list has been selected (focus has been moved from one item to another).

Declaration

SelectedIndexChanged: ASPxClientEvent<ASPxClientProcessingModeEventHandler<ASPxClientComboBox>>

Event Data

The SelectedIndexChanged event's data class is ASPxClientProcessingModeEventArgs. The following properties provide information specific to this event:

Property Description
processOnServer Specifies whether or not to process the event on the server.

Remarks

The SelectedIndexChanged event occurs on the client side, whenever selection is moved between items within a list editor. Write a handler for the SelectedIndexChanged event to perform tasks in response to an end-user selecting a different item from the editor’s list.

Example

This example demonstrates how to show the current item image within the ASPxComboBox text. To accomplish this task, handle the client-side ASPxClientComboBox.SelectedIndexChanged event, and change the background image of the control’s main HTML element. Also, you should set the ASPxComboBox.BackgroundImage.ImageUrl on the server side to synchronize the selected image. It is necessary to manually adjust the paddings and control height.

The complete sample project is available in the DevExpress Code Central database at E1317.

function SetComboBoxImage(s){
    var cbstyle = s.mainElement.style;
    cbstyle.backgroundImage = 'url('+(s.GetSelectedItem().imageUrl)+')';
    cbstyle.backgroundRepeat = "no-repeat";    
    cbstyle.backgroundPosition = "2px";
}
See Also