ASPxClientListBox.SelectedIndexChanged Event
Occurs on the client side after a different item in the list box has been selected (focus has been moved from one item to another).
Declaration
SelectedIndexChanged: ASPxClientEvent<ASPxClientListEditItemSelectedChangedEventHandler<ASPxClientListBox>>
Event Data
The SelectedIndexChanged event's data class is ASPxClientListEditItemSelectedChangedEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
index | Gets the index of the item related to the event. |
isSelected | Gets whether the item has been selected. |
processOnServer | Specifies whether or not to process the event on the server. Inherited from ASPxClientProcessingModeEventArgs. |
Remarks
The SelectedIndexChanged event occurs on the client side whenever selection is moved between items within the list box 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.
Note that the ASPxClientListEditItemSelectedChangedEventArgs.index property value is -1 when the “Select All” check box is clicked.
Example
This part of the Multiple Selection demo illustrates how to use multi-selection mode for the ASPxListBox editor.
<dx:ASPxListBox ID="lbFeatures" runat="server" SelectionMode="CheckColumn" Height="210px"
DataSourceID="Features" ValueField="ID" ValueType="System.String" TextField="Name">
<ClientSideEvents SelectedIndexChanged="function(s, e) {lbModels.PerformCallback('1');}" />
</dx:ASPxListBox>
<dx:ASPxListBox ID="lbModels" runat="server" SelectionMode="CheckColumn"
Height="210px" width="250px" ClientInstanceName="lbModels"
DataSourceID="PhoneModels" ValueField="ID" ValueType="System.String"
OnCallback="lbModels_Callback" >
<Columns>
<dx:ListBoxColumn FieldName="Name" Caption="Model" width="100%"/>
<dx:ListBoxColumn FieldName="Price" width="50px"/>
</Columns>
</dx:ASPxListBox>
protected void lbModels_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e) {
FilterModels(lbFeatures.Items);
lbModels.DataBind();
}
protected void FilterModels(ListEditItemCollection items) {
...
}
...