How to add a new row in the GridView control by using the GridView Footer TemplateIn this article we will see how to add a new row in the GridView control by using the GridView footer template. Steps to add a new row in the GridView control by using the GridView footer template are:
Declare <FooterTemplate> element within the TemplateField element which is used for adding a new record in the GridView control. Within the <FooterTemplate>, define the server control which is used to accept new data.
The below code demonstrates how to use <FooterTemplate> and how to add DropDownList in the <FooterTemplate> of the GridView control. The Grid View control displays DropDownList control for selecting new accounts.
After the above steps are completed, write the Event handler for the GridView RowCommand event. In the Event handler program the following.
Add a new row to the DataTable. Retrieve the values of controls (DropDownList and TextBox controls) which are in the Footer Template. Assign the values entered by the user to the row and assign the row to the DataTable.
For a detailed explanation of how to add a new row in the GridView control by using the GridView footer template, refer the title :Develop ERP software using ASP.Net 3.5 and C#.
Become an Expert
People also viewed: Create your own ERP Software using ASP Core>>