 <p>Add a hidden field to your aspx page.</p> <pre><code> &lt;asp:HiddenField ID="hfrecordID" runat="server" /&gt; </code></pre> <p>And assign the recodId to it in the ItemDataBound event and use it in the aspx page.</p> <pre><code> &lt;telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"&gt; &lt;script type="text/javascript"&gt; function ViewCheck(filename) { var targetfile = "Allegati/" + &lt;%= hfrecordID.value %&gt; + filename; var openWnd = radopen(targetfile, "RadWindowDetails"); } &lt;/script&gt; protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridEditableItem &amp;&amp; e.Item.IsInEditMode) { GridEditableItem editedItem = e.Item as GridEditableItem; hfrecordID= editedItem.GetDataKeyValue("TransazioneID").ToString(); } } </code></pre>