Skip to main content

GridViewSelection.UnselectRow(Int32) Method

Deselects the row specified by its visible index.

Namespace: DevExpress.Web.Data

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web


public void UnselectRow(
    int visibleIndex


Name Type Description
visibleIndex Int32

The row’s visible index.


Use the SelectRow(Int32) and UnselectRow methods to select and deselect the row specified by its visible index.

When the row selection changes, the control raises the client-side ASPxClientGridView.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.

The code sample below gets the current selection state of the row with the specified visible index and changes it.

<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="Change 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