Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a Gridview, with existing column ,But i want add some more column with text Box value (column name is textbox value) on button click event (user can add column). Gridview Auto generated Column is false..
ASP.NET
<asp:TextBox ID="colmtst" runat="server"></asp:TextBox>
      <asp:Button ID="crtcolm" runat="server" Text="Create Column"
           onclick="crtcolm_Click" />
Posted

1 solution

Refer - http://aspsnippets.com/Articles/Dynamically-add-BoundField-and-TemplateField-Columns-to-GridView-in-ASPNet.aspx[^].

Go through this and just add your logic to add column when you need.
 
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