Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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:

JavaScript
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);
    }


Index value is 0 and row value is null.

This is my ajax GridView:

ASP.NET
<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>


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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900