获取ajaxdata gridview的选定行值 [英] Get selected row values of ajaxdata gridview

查看:80
本文介绍了获取ajaxdata gridview的选定行值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个显示从Web服务检索到的数据的div。并且网格的每一行中都有一个额外的按钮,允许用户提取该行的数据。问题是我不知道如何从AjaxData GridView中捕获数据选择的数据。我在javaScript中尝试过这个函数,但它无法正常工作:



Hi all,
I have a div that displays data retrieved from a web service. And there is in additional button in each row of the grid that allows the user to extract data of this row. The problem is that I don't know how to catch data selected data from AjaxData GridView. I tried this function in javaScript but it is not working:

function extractFunction(sender,e) {
      var index = e.get_row().get_rowIndex();
      var gridView = $find('<%= grdvPriorApproval.ClientID %>');
      var row = gridView._rows[index].findControl('lblClaimhID').value;
     __doPostBack('CustomPostBack', row);
    }





指数值为0且行值为空。



这是我的ajax GridView:





Index value is 0 and row value is null.

This is my ajax GridView:

<div class="modal-body">
   <ajaxdata:gridview id="grdvPriorApproval" runat="server" rowcommandevent="extractFunction">
       <columns>
          <ajaxdata:gridviewtemplatecolumn headertext="ClaimhId" sortfield="ClaimhId" visible="False">
              <edititemtemplate>
                  <asp:TextBox ID="txtClaimhID" runat="server" 

                  Text=<%# Bind("ClaimhId")%>>
              
              <itemtemplate>
                  <asp:Label ClientIDMode="Static" ID="lblClaimhID" runat="server" 

                   Text=<%# Bind("ClaimhId") %>>
              
          
          <ajaxdata:gridviewcommandcolumn controlstyle-font-bold="true" controlstyle-forecolor="#f2fae5" controlstyle-backcolor="#6c9815" buttontype="Button" selecttext="Extract" showselectbutton="True">
          
       
     
</div>





我的尝试:



我试图将我的网格现在更改为telegrid,但我无法在gridview中填充来自我的webservice的数据。所以我更喜欢使用ajaxData。



What I have tried:

I tried to change my grid now to telegrid, but I could not fill data from my webservice in in gridview. So I prefer to use ajaxData.

推荐答案

find(' <%= grdvPriorApproval.ClientID%>');
var row = gridView._rows [index] .findControl(' lblClaimhID')值。
__doPostBack(' CustomPostBack',row);
}
find('<%= grdvPriorApproval.ClientID %>'); var row = gridView._rows[index].findControl('lblClaimhID').value; __doPostBack('CustomPostBack', row); }





指数值为0且行值为空。



这是我的ajax GridView:





Index value is 0 and row value is null.

This is my ajax GridView:

<div class="modal-body">
   <ajaxdata:gridview id="grdvPriorApproval" runat="server" rowcommandevent="extractFunction">
       <columns>
          <ajaxdata:gridviewtemplatecolumn headertext="ClaimhId" sortfield="ClaimhId" visible="False">
              <edititemtemplate>
                  <asp:TextBox ID="txtClaimhID" runat="server" 

                  Text=<%# Bind("ClaimhId")%>>
              
              <itemtemplate>
                  <asp:Label ClientIDMode="Static" ID="lblClaimhID" runat="server" 

                   Text=<%# Bind("ClaimhId") %>>
              
          
          <ajaxdata:gridviewcommandcolumn controlstyle-font-bold="true" controlstyle-forecolor="#f2fae5" controlstyle-backcolor="#6c9815" buttontype="Button" selecttext="Extract" showselectbutton="True">
          
       
     
</div>





我的尝试:



我试图将我的网格现在更改为telegrid,但我无法在gridview中填充来自我的webservice的数据。所以我更喜欢使用ajaxData。



What I have tried:

I tried to change my grid now to telegrid, but I could not fill data from my webservice in in gridview. So I prefer to use ajaxData.


这篇关于获取ajaxdata gridview的选定行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆