Click here to Skip to main content
15,908,254 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi
I want to create the gridview contains textbox created dynamically

for example

ID    name    pdt1    pdt2.....(dynamic
1    aaa    textbox    textbox
2    bbb    textbox    textbox

any suggestions pls...............
Posted
Updated 14-Feb-14 17:32pm
v3

XML
<asp:GridView ID="GridView1" runat="server" ShowFooter="true">
 <Columns>
  <asp:TemplateField HeaderText="ID">
   <ItemTemplate>
     <asp:Label ID="lblService" runat="server" Text='<%# Eval("ID")%>'></asp:Label>
   </ItemTemplate>
  </asp:TemplateField>
  <asp:TemplateField HeaderText="text1">
    <ItemTemplate>
      <asp:TextBox ID="txt1" runat="server" Text='<%# Eval("txt1")%>'></asp:TextBox>
    </ItemTemplate>
    <FooterTemplate>
      <asp:TextBox ID="txt1" runat="server"></asp:TextBox>
    </FooterTemplate>
   </asp:TemplateField>
  <asp:TemplateField HeaderText="text2">
    <ItemTemplate>
      <asp:TextBox ID="txt2" runat="server" Text='<%# Eval("txt2")%>'></asp:TextBox>
    </ItemTemplate>
    <FooterTemplate>
      <asp:TextBox ID="txt2" runat="server"></asp:TextBox>
    </FooterTemplate>
   </asp:TemplateField>
   <asp:TemplateField ItemStyle-Width="50px" HeaderText="Delete">
     <FooterTemplate>
       <asp:Button ID="btnAdd" runat="server" OnClick="AddNewText" />
     </FooterTemplate>
   </asp:TemplateField>
 </Columns>
</asp:GridView>
 
Share this answer
 
v2
Comments
V Senthil Kumar 15-Jun-15 7:05am    
can you show c# code?
 
Share this answer
 
 
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