I have a Gridview with Auto Generate Columns="False".I am using a Template Field to display my Edit, Update and Cancel 'buttons' in the first column of the Grid View within respective Item Template and Edit Item Template fields.Also, in the above image we have three rows of data and last blank row is there to add new row.
But we must always take care when such developer friendly control must be used. built in support for sorting, caching, paging or editing.It also provide ways to modify and delete records but currently there is no way to insert record using Grid View. This is one of the most powerful control in to work with data. For simplicity reason I shall not show the database manipulation code here.In this article, I shall describe an easy work around to insert record using Grid View. The first thing we need to consider here is that if there is no record in the Grid View Datasource, it should display a Form to insert records, so we shall use Empty Data Template to render the Insert form. Grid View with No Record When there is data in the Grid View, Empty Data Template form will not display. Net grid view control can be customized in many ways according to our requirements basically, in a situation where we want to add the data row from the grid view interface.In this case, when the Data Table is not empty, then the last blank row will appear if we enable “Show Footer” property of Grid View to true and vice versa.