ASPxGridBase.SelectionChanged Event
Fires after the selection has been changed.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v18.2.dll
Declaration
Event Data
The SelectionChanged event's data class is EventArgs.
Remarks
The grid (ASPxGridView, ASPxVerticalGrid, ASPxCardView) allows end users to select/deselect multiple rows using the Select command item or in code using the following APIs:
- The ASPxGridView.Selection property.
- The ASPxCardView.Selection property.
- The ASPxVerticalGrid.Selection property.
Handle the SelectionChanged event to respond to a selection change.
Note
If the ASPxGridBehaviorSettings.ProcessSelectionChangedOnServer property is set to false, the grid fires a client SelectionChanged event (ASPxClientGridView.SelectionChanged, ASPxClientCardView.SelectionChanged, ASPxClientVerticalGrid.SelectionChanged) on the client side without a postback to the server. Set this property to true to finally process the selection on the server side and use the SelectionChanged event.
Concept
Example
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="CategoryID" OnSelectionChanged="ASPxGridView1_SelectionChanged">
<SettingsBehavior ProcessSelectionChangedOnServer="True" />
<Columns>
...
</Columns>
</dx:ASPxGridView>
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SelectionChanged event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.