GridViewSelection.UnselectRowByKey(Object) Method

Unselects the specified row within the ASPxGridView.

Namespace: DevExpress.Web.Data

Assembly: DevExpress.Web.v21.1.dll

Declaration

public void UnselectRowByKey(
    object keyValue
)

Parameters

Name Type Description
keyValue Object

An object that identifies the data row by its key value.

Remarks

The following example shows how to unselect the focused row (if it is selected):

// Checks whether the focused row is displayed within the grid.
if (ASPxGridView1.FocusedRowIndex == -1) return;
// Checks whether the focused row is selected.
if (!ASPxGridView1.Selection.IsRowSelected(ASPxGridView1.FocusedRowIndex)) return;
// Obrains the focused row's key value.
object focusedRowKey = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, ASPxGridView1.KeyFieldName);
// Unselects the focused row.
ASPxGridView1.Selection.UnselectRowByKey(focusedRowKey);
See Also