Back to Devexpress

ASPxClientGridView.SelectRowOnPage(visibleIndex) Method

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

latest1.6 KB
Original Source

ASPxClientGridView.SelectRowOnPage(visibleIndex) Method

Selects or deselects the row specified by its visible index.

Declaration

ts
SelectRowOnPage(
    visibleIndex: number,
    selected?: boolean
): void

Parameters

NameTypeDescription
visibleIndexnumber

The row’s visible index.

| | selected | boolean |

true or undefined to select the specified row; false to deselect the row.

|

Remarks

Pass the row’s visible index as a parameter to the SelectRowOnPage(visibleIndex) method to select or deselect the corresponding row.

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).

aspx
<dx:ASPxGridView ClientInstanceName="grid" runat="server">
    <%--...--%>
</dx:ASPxGridView>
js
// Selects the 1st row
grid.SelectRowOnPage(0);

// Selects the 3rd row
grid.SelectRowOnPage(2, true);

// Deselects the 1st row
grid.SelectRowOnPage(0, false);

You can call the SelectAllRowsOnPage method to select all rows within the current page.

See Also

ASPxClientGridView Class

ASPxClientGridView Members