<asp:GridView ID="GridView1" runat="server" Font-Names="Arial" Font-Size="XX-Small" Style="z-index: 118; left: 174px; position: absolute; top: 421px" Width="543px" Height="66px" EmptyDataText="--- Empty Grid ---" AllowPaging="True" Caption="Customer Status Report" CaptionAlign="Top" DataKeyNames="Item #" > </asp:GridView> <asp:textbox ID="Textbox1" runat="server"></asp:textbox> <asp:textbox ID="Textbox2" runat="server"></asp:textbox> <asp:Button ID="Button2" runat="server" Text="Begin" OnClick="Button2_Click" /> <asp:Button ID="Button3" runat="server" Text="Add new" OnClick="Button3_Click" style="z-index: 1;font-family:Sans-Serif; height:22px; left:122px; margin-top:100px; font-weight:900; " />
protected void Button2_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Item #", typeof(int))); dt.Columns.Add(new DataColumn("Customer Name", typeof(string))); dt.Columns.Add(new DataColumn("Contract Number", typeof(string))); DataRow dr = dt.NewRow(); dr["Item #"] = 1;// i; dr["Customer Name"] = Textbox1.Text; dr["Contract Number"] = Textbox2.Text; dt.Rows.Add(dr); this.GridView1.Visible = true; GridView1.DataSource = dt; GridView1.DataBind(); } protected void Button3_Click(object sender, EventArgs e) //to add new rows to GV { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)