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

[Solved] Get row by DataKeyValue

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lyle Groome
Top achievements
Rank 2
Lyle Groome asked on 18 Sep 2009, 02:09 PM
I have a RadGrid with ClientDataKeyNames="CredentialId"

From the codebehind I call a JavaScript function. This function gets passed in a CredentialId. So I know the CredentialId of the row that I want. Now how do I get the row?

 



1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Sep 2009, 05:21 AM
Hello Lyle Groome,

You can try out the follwoing code to access the row on the client with the help of the datakeyname of that row:
js:
 function show(keyValue) 
    { 
       var Rows = $find("<%=RadGrid1.ClientID %>").get_masterTableView().get_dataItems(); 
       for (var i = 0; i < Rows.length; i++) 
       { 
         var row = Rows[i]; 
         if(row.getDataKeyValue("CredentialId")==keyValue) 
              alert(row);     
       }   
    } 

Thanks
Princy.
Tags
Grid
Asked by
Lyle Groome
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or