hi,
I am having a scenario,where i am using GridView + Dataset as datasource + .NET2.0 + VB.NET 2005.
I need to add more rows on runtime to GridView so
i need to first read the data from dataset and fill my GridView and then have an Add button which adds a new row on click ( for each column).
here is what i've done:
i just added a textbox in <ItemTemplate> for each <TemplateField> column
Unfotunately i am not able to get it to work.Code:<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Style="z-index: 106; left: 40px; position: absolute; top: 188px" CellPadding="4" ForeColor="#333333" GridLines="None"> <Columns> <asp:TemplateField HeaderText="Milestone"> <ItemTemplate> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Planned date"> <ItemTemplate> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Actual Date"> <ItemTemplate> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="% Complete"> <ItemTemplate> <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Progress Date"> <ItemTemplate> <asp:TextBox ID="TextBox5" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Comments"> <ItemTemplate> <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>
i really need this to work and i apreciate your help.waiting for ur reply, thanks again
PS: i included a gif file which demonstrates what i am intending to do




Reply With Quote