Skip to main content

ASPxGridView.Selection Property

Gets an object that allows you to access row selection methods.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.1.dll

NuGet Package: DevExpress.Web


public GridViewSelection Selection { get; }

Property Value

Type Description

An object that contains row selection methods.


The Selection property returns the GridViewSelection object. It contains methods that allow you to select or deselect data rows, and get information about the current row selection state.

When the row selection changes, the control raises the client-side ClientGridView.SelectionChanged or the server-side ASPxGridBase.SelectionChanged event (based on the ProcessSelectionChangedOnServer property value).

For more information on row selection in the grid, refer to the following topic: Selection.

<dx:ASPxGridView ID="gridview" ClientInstanceName="grid" runat="server" AutoGenerateColumns="False"
    KeyFieldName="ProductID" OnCustomCallback="gridview_CustomCallback">
        <dx:GridViewCommandColumn ShowSelectCheckbox="true" VisibleIndex="0" />
<br />
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Invert selection state" AutoPostBack="false">
    <ClientSideEvents Click="onButtonClick" />
function onButtonClick(s, e) {
protected void gridview_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) {
    var grid = sender as ASPxGridView;
    var visibleIndex = 0;
    if(grid.Selection.IsRowSelected(visibleIndex)) {
    } else {
See Also