-1

I am displaying a collapsible grid view, when the user clicks the img, the 2nd nested grid view collapses. It works perfectly, except the grid 2 takes a parameter of grid view1 id, to keep the rows unique to each row.

The img code works (without the command argument).

What I am trying to achieve is to pass the grid view 1 id to this nested grid function (which is behind code) so that I can have unique rows displayed. I thought about doing this with the command argument, but like I explained above, the img didn't take command argument. When I tried a btnimg, the button img could take the command argument, but it then didn't like my onclick jquery.

Code:

<asp:TemplateField>
  <ItemTemplate>
    <asp:ImageButton Class="btnArrow" ImageUrl="~/img/close-arrow.png" 
       OnClick="ShoeHide(this, 'tr<%# Eval("OrderNumber") %>');"
       CommandArgument='<%#Eval("OrderNumber")%>' runat="server" />
       <%-- <asp:ImageButton Class="btnArrow" ImageUrl="/img/close-arrow.png" 
       CommandArgument='<%#Eval("odernumber")%>'   
       OnClick="ShoeHide(this, 'tr<%# Eval("OrderNumber") %>')"  runat="server" />--%> 
  </ItemTemplate>
</asp:TemplateField>
mplungjan
  • 169,008
  • 28
  • 173
  • 236
Von Kelly
  • 3
  • 6
  • Please include the source code for `ShoeHide`. Also, please include the generated HTML (View Source from your browser). – mjwills Aug 14 '17 at 13:59

1 Answers1

0

move the click event out of the element

<script type="text/javascript">
    $(function () {
        $('.btnArrow').click(function () {
            // something here
        });
    }
</script>
Drytin
  • 366
  • 2
  • 8