Back to Devexpress

ASPxClientGridView.IsRowSelectedOnPage(visibleIndex) Method

aspnet-js-aspxclientgridview-dot-isrowselectedonpage-x28-visibleindex-x29.md

latest1.4 KB
Original Source

ASPxClientGridView.IsRowSelectedOnPage(visibleIndex) Method

Indicates whether the specified row is selected.

Declaration

ts
IsRowSelectedOnPage(
    visibleIndex: number
): boolean

Parameters

NameTypeDescription
visibleIndexnumber

The row’s visible index.

|

Returns

TypeDescription
boolean

true if the specified row is selected on the current page; otherwise, false.

|

Remarks

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.

aspx
<dx:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server">
</dx:ASPxGridView>
<dx:ASPxButton ID="Button" runat="server" Text="Change selection state" AutoPostBack="false">
    <ClientSideEvents Click="ChangeSelectionState" />
</dx:ASPxButton>
js
function ChangeSelectionState(s, e) {
    var state = grid.IsRowSelectedOnPage(2);
    grid.SelectRowOnPage(2, !state);
}

See Also

ASPxClientGridView Class

ASPxClientGridView Members