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

Grid : Storing ID

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Angella
Top achievements
Rank 1
Angella asked on 07 Mar 2012, 06:10 AM
Hi all,
  I want to store the ID of each row which can be retrieved on the client side. At the same time, it is not shown to  the user. How to implement this?
Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Mar 2012, 07:03 AM
Hello,

Try the following code.
ASPX:
<MasterTableView ClientDataKeyNames="DataKeyName" >
JS:
function OnClientClick(sender, args)
{
       var MasterTable = sender.get_masterTableView();
       var row = MasterTable.get_dataItems()[args.get_itemIndexHierarchical()];
       alert(row.getDataKeyValue("DataKeyName"));
}

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