title: how to get item template value on asp datagridview
body: <p>i got datagridview like this :</p>
  
  <pre><code>&lt;asp:GridView ID="gvData" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                              CellPadding="4" DataKeyNames="InquiryId" Font-Size="11px" ForeColor="Black" PageSize="20"
                              Width="100%" Style="text-align: center" CssClass="zebra" AlternatingRowStyle-CssClass="even"&gt;
                              &lt;AlternatingRowStyle CssClass="even" /&gt;
                              &lt;Columns&gt;
                                  &lt;asp:TemplateField&gt;
                                  &lt;ItemStyle HorizontalAlign="Center" Width="100px" /&gt;
                                      &lt;FooterStyle HorizontalAlign="Left" /&gt;
                                      &lt;ItemTemplate&gt;
                                         &lt;asp:ImageButton ID="imgbtn" ImageUrl="~/Edit.jpg" runat="server" Width="25" Height="25" onclick="imgbtn_Click" /&gt;
                                      &lt;/ItemTemplate&gt;
                                      &lt;EditItemTemplate&gt;
                                      &lt;/EditItemTemplate&gt;
                                      &lt;FooterTemplate&gt;
                                      &lt;/FooterTemplate&gt;
                                  &lt;/asp:TemplateField&gt;
                                  &lt;asp:TemplateField HeaderText="No Account"&gt;
                                      &lt;ItemStyle HorizontalAlign="Center" Width="100px" /&gt;
                                      &lt;FooterStyle HorizontalAlign="Left" /&gt;
                                      &lt;ItemTemplate&gt;
                                          &lt;asp:Label ID="lblNoaccount0" runat="server" Text='&lt;%# Bind("InquiryAccount") %&gt;'&gt;&lt;/asp:Label&gt;
                                      &lt;/ItemTemplate&gt;
                                      &lt;EditItemTemplate&gt;
                                      &lt;/EditItemTemplate&gt;
                                      &lt;FooterTemplate&gt;
                                      &lt;/FooterTemplate&gt;
                                  &lt;/asp:TemplateField&gt;
                                  &lt;asp:TemplateField HeaderText="Language"&gt;
                                      &lt;ItemStyle HorizontalAlign="center" Width="50px" /&gt;
                                      &lt;FooterStyle HorizontalAlign="Left" /&gt;
                                      &lt;ItemTemplate&gt;
                                          &lt;asp:Label ID="lblSlotTime" runat="server" Text='&lt;%# Bind("InquiryLang") %&gt;'&gt;&lt;/asp:Label&gt;
                                      &lt;/ItemTemplate&gt;
                                  &lt;/asp:TemplateField&gt;
                                  &lt;asp:TemplateField HeaderText="Amount"&gt;
                                      &lt;ItemStyle HorizontalAlign="Center" Width="20px" /&gt;
                                      &lt;FooterStyle HorizontalAlign="Left" /&gt;
                                      &lt;ItemTemplate&gt;
                                          &lt;asp:Label ID="lblInquiryAmount" runat="server" Text='&lt;%# Bind("InquiryAmount") %&gt;'&gt;&lt;/asp:Label&gt;
                                      &lt;/ItemTemplate&gt;
                                  &lt;/asp:TemplateField&gt;
                                  &lt;asp:TemplateField HeaderText="Response"&gt;
                                      &lt;ItemStyle HorizontalAlign="Center" Width="70px" /&gt;
                                      &lt;FooterStyle HorizontalAlign="Center" /&gt;
                                      &lt;ItemTemplate&gt;
                                          &lt;asp:Label ID="lblResponse" runat="server" Text='&lt;%# Bind("InquiryResponse") %&gt;'&gt;&lt;/asp:Label&gt;
                                      &lt;/ItemTemplate&gt;
                                  &lt;/asp:TemplateField&gt;
  
                              &lt;/Columns&gt;
  
                          &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>and i want to get row value by clicking the image button, here's the code :</p>
  
  <pre><code> Protected Sub imgbtn_Click(ByVal sender As Object, ByVal e As ImageClickEventArgs)
          Dim btndetails As ImageButton = TryCast(sender, ImageButton)
          Dim gvrow As GridViewRow = DirectCast(btndetails.NamingContainer, GridViewRow)
          lblID.Text = gvData.DataKeys(gvrow.RowIndex).Value.ToString()
          lblusername.Text = gvrow.Cells(1).Text
          txtfname.Text = gvrow.Cells(2).Text
          txtlname.Text = gvrow.Cells(3).Text
          txtCity.Text = gvrow.Cells(4).Text
          txtDesg.Text = gvrow.Cells(5).Text
          Me.pnlGrid_ModalPopupExtender.Show()
      End Sub
  </code></pre>
  
  <p>but when i debug it, i only get the <code>gvData.DataKeys(gvrow.RowIndex).Value.ToString()</code> value, the others value just give me the empty string. whats wrong with my code??</p>