You have to set
Gridview's
Property
Allowpaging=true
In code you have written a code in pageindexchanging.
gridview1.pageindex=e.newpageindex;
gridview1.databind();
In above code you are missing the datasource for Gridview, or you can call the same function which you have used to fill the Gridview.
gridview1.pageindex=e.newpageindex;
gridview1.datasource=dt;
gridview1.databind();
Thanks