Advertisement

09.03.2008 at 02:26AM PDT, ID: 23698570 | Points: 250
[x]
Attachment Details

insert row on gridview on click of a button

Asked by nokitel85 in WebApplications, Web Languages/Standards, Active Server Pages (ASP)

I would like to add a new row with the same apearance as the rows above to my gridview by pressing an "insert" button.

Here is my gridview:Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns=false OnRowDataBound="GridView1_RowDataBound">
                    <Columns> 
                        <asp:TemplateField >
                            <HeaderTemplate>
                                <asp:Label ID="lb_grd_txt_nameId" CommandName="nameId" runat="server" BorderStyle="None" >nameId</asp:Label>                                                                                                                                    
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:TextBox Font-Size="12px" ID="t_grd_txt_nameId" runat="server" Text='<%#Bind("nameId")%>'></asp:TextBox>                                            
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField >
                            <HeaderTemplate>
                                <asp:Label ID="lb_grd_txt_name1" CommandName="name1" runat="server" BorderStyle="None" >name</asp:Label>                                                                                                                                    
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:TextBox Font-Size="12px" ID="t_grd_txt_name1" runat="server" Text='<%#Bind("name1")%>'></asp:TextBox>                                            
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField >
                            <HeaderTemplate>
                                <asp:Label ID="lb_grd_txt_description" CommandName="description" runat="server" BorderStyle="None" >description</asp:Label>                                                                                                                                    
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:TextBox Font-Size="12px" ID="t_grd_txt_description" runat="server" Text='<%#Bind("description")%>'></asp:TextBox>                                            
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField >
                            <HeaderTemplate>
                                <asp:LinkButton ID="lb_grd_txt_sort" CommandName="sort" runat="server" BorderStyle="None" OnClick="SortColumn" >sort</asp:LinkButton>                                                                                                                                    
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:TextBox Font-Size="12px" ID="t_grd_txt_sort" runat="server" Text='<%#Bind("sort")%>'></asp:TextBox>                                            
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField >
                            <HeaderTemplate>
                                <asp:Label ID="lb_grd_txt_status" CommandName="status" runat="server" BorderStyle="None" >status</asp:Label>                                                                                                                                    
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:TextBox Font-Size="12px" ID="t_grd_txt_status" runat="server" Text='<%#Bind("status")%>'></asp:TextBox>                                            
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField >
                            <HeaderTemplate>
                                <asp:Label ID="lb_grd_txt_nameTypeId" CommandName="nameTypeId" runat="server" BorderStyle="None" >nameTypeId</asp:Label>                                                                                                                                    
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:TextBox Font-Size="12px" ID="t_grd_txt_nameTypeId" runat="server" Text='<%#Bind("nameTypeId")%>'></asp:TextBox>                                            
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
 
Loading Advertisement...
 
[+][-]09.03.2008 at 03:00AM PDT, ID: 22375508

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 11:37AM PDT, ID: 22391045

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 01:49PM PDT, ID: 22392544

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906