This is a migrated thread and some comments may be shown as answers.

function java script selected rowns

3 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rafael
Top achievements
Rank 1
Rafael asked on 07 Feb 2012, 12:48 PM
Hello. I need to select the row index of the grid by using javascriptfunction .. first get the index of selected then select the next. sorry for bad english .. Help? 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Feb 2012, 01:32 PM
Hello,

Try the following Javascript.
Javascript:
function OnClientClick()
{
 var grid = $find("<%=RadGrid1.ClientID%>");
 var MasterTable = grid.get_masterTableView();
 var row = MasterTable.get_selectedItems();
 for (var i = 0; i < row.length; i++)
 {
  alert(row[i]._itemIndexHierarchical[i]);
 }
}

-Shinu.
0
Rafael
Top achievements
Rank 1
answered on 07 Feb 2012, 02:22 PM
Can still help? I do not know why but the method using the following error appears: Can not get property value 'get_selectedItems': the object is null or not definido.qual would be the problem? 
0
Shinu
Top achievements
Rank 2
answered on 08 Feb 2012, 05:58 AM
Hello Rafael,

I cannot reproduce the issue at my end. The above code illustrates how to get the row index of the selected row.

-Shinu.
Tags
Grid
Asked by
Rafael
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Rafael
Top achievements
Rank 1
Share this question
or