Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi
Thank you for Reply.

We are using Gridview in that i have one button and one text box when ever we click button that text must be visible how to do it using javascript or jquery.




Thanks & Regards
Lakshman
Posted
Updated 2-Feb-16 22:17pm
v2
Comments
aarif moh shaikh 28-Jan-16 5:06am    
<asp:GridView ID="gv" runat="server">
<columns>
<asp:TemplateField>
<itemtemplat>
<asp:Button ID="btnms" runat="server">
</itemtemplate>

</columns>
Manoj Sawant 28-Jan-16 5:10am    
what did you try
aarif moh shaikh 3-Feb-16 4:32am    
what have you try?
without datasource, we can't display any internal control in gridview.

1 solution

You can add button and textbox in the following manner so that when click on button textbox will be shown:
ASP
<asp:content id="BodyContent" contentplaceholderid="MainContent" runat="server" xmlns:asp="#unknown">

    <div class="jumbotron">

                <asp:gridview autogeneratecolumns="false" id="gdv1" runat="server">
            <columns>
                <asp:boundfield datafield="ID" />
                <asp:boundfield datafield="FirstName" />
                <asp:boundfield datafield="LastName" />
                <asp:templatefield>
                    <itemtemplate>
                        <input type="text" id="<%#Eval("ID") %>" hidden="hidden" />
                    </itemtemplate>
                </asp:templatefield>
                <asp:templatefield>
                  <itemtemplate>
                      <input type="button"  value="show" onclick="Show(this)"  />
                  </itemtemplate>
                </asp:templatefield>
            </columns>

        </asp:gridview>

            
        
    </div>

  
 
<script type="text/javascript">
    function Show(e) {
      
        $row = $(e).parent().siblings("").find('input');

        $row.show();


    }
</script>

</asp:content>
 
Share this answer
 

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