So I have a datatable on my website and it displayed 10-20 rows of filled data. I have added a line of code that inserts a empty row in the existing datatable with the below code:
dt.Rows.InsertAt(datatable.NewRow, 8)
I also have this which is required for doing paging in the datatable:
Protected Sub GridView3_PageIndexChanging(sender As Object, e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView3.PageIndexChanging GridView3.PageIndex = e.NewPageIndex GridView3.DataBind()End Sub
The problem is when I move from page 1 to 2 then back to 1, all the inserted rows disappear leaving only the filled rows. Is there a way to keep the inserted rows?? Or does anyone have any explanation or solution for this?
Thanks.