GridViewSelection.UnselectRowByKey(Object) Method

Unselects the specified row within the ASPxGridView.

Namespace: DevExpress.Web.Data

Assembly: DevExpress.Web.v21.1.dll


public void UnselectRowByKey(
    object keyValue


Name Type Description
keyValue Object

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


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.
See Also