text box , ddl and button in footer by using FooterTemplate;
like;
<FooterTemplate> <asp:Button ID="Button1" runat="server" CommandName="Insert" Text="INSERT" OnClick="BtnInsert_Click" /> <asp:Button ID="Button2" runat="server" CommandName="Delete" Text="Delete" OnClick="BtnDelete_Click"/>
<asp:TextBox ID="txtId" runat="server"/>
use same to add ddl also </FooterTemplate>
Use this link for the same;
http://blog.binaryocean.com/2006/01/05/InsertRowsWithAGridView.aspx
Use this to add all the contents into footer of gridview;
And now when you click on Insert handle Btn_insert_click event and in that write code to add value into grid.
Now you dnt want to store these values in db, then first you have to take all the rows of gridview in one ds and then add new row in ds which will have new data.
Store this ds in a view state and then while feeling gridview take a upadted ds from this viewstate and attach all the rows to gridview like;
Dim ds As New DataSet
ds = ViewState( "Newds")
gridview1.DataSource = ds
gridview1.DataBind()
Best Luck!!!!!!!!!!!
Sujit. |