从 Telerik RadGridView 中的选定行获取隐藏列值

发布于 2024-11-03 04:22:13 字数 723 浏览 0 评论 0原文

如何获取 Telerik RadGridView 中隐藏列的选定行值?该列隐藏在 aspx 页面上,我想检索客户端(JavaScript)上的值。

本质上,我想在网格视图中显示一个名称,并能够从隐藏字段“ID”中检索一个值以打开一个编辑表单。

以下是我如何隐藏 RadGridView 列的示例。

代码示例:

    onKeyPressEvent(sender, args) { 
  var variable = function (e) { 
    e = e || window.event; 
    if (e.keyCode == 13) { 
      var PartyID = args.getDataKeyValue("PARTY_ID"); 
      var oManager = '<%=winMgr.ClientID %>';
      var oManager = window.radopen("AttorneyEdit.aspx?PARTY_ID=" + PartyID, null); 
      oManager.setSize(1000, 530); 
      //Width, Height oManager.center(); 
      } else { return true; 
      } 
  } 
  theForm.onkeypress = variable 
} 

感谢您的帮助...

How do I obtain the selected row value for a hidden column in a Telerik RadGridView? The column is hidden on the aspx page and I would like to retrieve the value on the client side (JavaScript).

Essentially, I want to display a name in the grid view and be able to retrieve a value from the hidden field "ID" to bring up an edit form.

Here is an example of how I'm hiding the RadGridView column.

code sample:

    onKeyPressEvent(sender, args) { 
  var variable = function (e) { 
    e = e || window.event; 
    if (e.keyCode == 13) { 
      var PartyID = args.getDataKeyValue("PARTY_ID"); 
      var oManager = '<%=winMgr.ClientID %>';
      var oManager = window.radopen("AttorneyEdit.aspx?PARTY_ID=" + PartyID, null); 
      oManager.setSize(1000, 530); 
      //Width, Height oManager.center(); 
      } else { return true; 
      } 
  } 
  theForm.onkeypress = variable 
} 

Thanks for your help...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

つ可否回来 2024-11-10 04:22:13

也许你走错了路。有一个名为“ClientDataKeyNames”在主表视图上。您可以在此属性中添加多个键,并用逗号分隔。然后您将能够获得您的值,而无需添加额外的列。

你应该做这样的事情:

 function onKeyPressEvent(sender, args) { 
    if (args.get_keyCode() == 13) {
        var dataItem=sender.get_selectedItems()[0];
        var PartyID = dataItem.getDataKeyValue("PARTY_ID"); 
        var oManager = '<%=winMgr.ClientID %>';
        var oManager = window.radopen("AttorneyEdit.aspx?PARTY_ID=" + PartyID, null); 
        oManager.setSize(1000, 530); 
        //Width, Height oManager.center(); 
        } 
        else { 
          return true; 
        } 
 } 

祝你好运

maybe you're going the wrong way. There is a property called "ClientDataKeyNames" on the mastertableview. You can add several key separated by a comma in this property. Then you'll be able to get your value without adding an extra column.

You should do something like this:

 function onKeyPressEvent(sender, args) { 
    if (args.get_keyCode() == 13) {
        var dataItem=sender.get_selectedItems()[0];
        var PartyID = dataItem.getDataKeyValue("PARTY_ID"); 
        var oManager = '<%=winMgr.ClientID %>';
        var oManager = window.radopen("AttorneyEdit.aspx?PARTY_ID=" + PartyID, null); 
        oManager.setSize(1000, 530); 
        //Width, Height oManager.center(); 
        } 
        else { 
          return true; 
        } 
 } 

good luck

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文