Click here to Skip to main content
16,005,206 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to add +/- button to a gridview for expanding and collapsing it( in relationship to the code in the link below)
How to Create TreeView Type GridView[^]
Posted
Comments
Karthik_Mahalingam 26-Jan-14 3:06am    
what problem u r facing?

1 solution

For the GridView to work with the code in the link you provided you need, at minimum, the following settings.
ASP.NET
<asp:GridView ID="GridView1" runat="server" OnRowCommand="GridView1_RowCommand" OnRowCreated="GridView1_RowCreated" OnRowDataBound="GridView1_RowDataBound">
<Columns>
    <asp:TemplateField HeaderText="Root">
        <ItemTemplate>
            <asp:Button ID="MinBT" runat="server" CommandName="_Hide" Text="-" />
            <asp:Button ID="PluseBT" runat="server" CommandName="_Show" Text="+" Visible="false"/>
        </ItemTemplate>
    </asp:TemplateField>
</Columns>
</asp:GridView>
 
Share this answer
 
v2
Comments
Member 9493720 26-Jan-14 6:07am    
I am new to ASP.net. I came to know that this thing can be done using Item template.

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

  Print Answers RSS


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