RadControls for ASP.NET AJAX
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 - <tr> | The row that will be selected. |
index | Integer |
The row corresponding to the index will be selected.
|
Example:
CopyJavaScript
function SelectFirstItem() {
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
masterTable.clearSelectedItems();
masterTable.selectItem(masterTable.get_dataItems()[0].get_element());
}