Skip to main content
A newer version of this page is available. .

ASPxClientGridView.SelectRowsByKey(keys) Method

Selects or deselects the specified row in the grid.

Declaration

SelectRowsByKey(
    keys: any[] | any,
    selected?: boolean
): void

Parameters

Name Type Description
keys any[] | any
selected boolean

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

Remarks

Note

  • If multiple key fields are set via the grid’s ASPxGridBase.KeyFieldName property, a specific service vertical bar symbol (the symbol |) is used to separate key field values in the string returned by the SelectRowsByKey method.
  • The SelectRowsByKey method sends callback to accomplish selection.

Concept

Example

  function OnInit(s, e) {
            var keys = [];
            var count = selList.GetItemCount();
            if (count != 0) {
                for (var i = 0; i < count; i++)
                    keys.push(selList.GetItem(i).value);
                s.SelectRowsByKey(keys);
            }
            else s.UnselectRows();
        }
See Also