Edit this page

selectItem

Method which selects the table row passed as an argument or the row corresponding to the index passed as an argument. If you want to have single row selected at a time (meaningful with multi-row selection enabled), execute the clearSelectedItems() method prior to the call to the selectItem(gridItem) method.

caution

If the -index- passed as argument does not correspond to item of type GridDataItem, the next GridDataItem (immediately below the item with argument -index- ) will be selected.

selectItem(gridItem) or selectItem(index)
gridItem HTML row object -
The row that will be selected.
index Integer The row corresponding to the index will be selected.

Example:

function SelectFirstItem() {
    var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    //clear the previously selected items if necessary
    masterTable.clearSelectedItems();
    masterTable.selectItem(masterTable.get_dataItems()[0].get_element());
}