Hi,
A event called PageIndexChanging is there with gridview. You can use that for the paging. Here is a sample code:
protected void gvArticals_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
try
{
gvArticals.DataSource = dtArticle;
gvArticals.PageIndex = e.NewPageIndex;
gvArticals.DataBind();
}
catch (Exception ex)
{
}
}
Yes, now you want a loading image for gridview while paging. Put your gridview inside asp:UpdatePanel and asp:UpdateProgress. Example:
<asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
</asp:scriptmanager>
<asp:updateprogress id="updProgress" xmlns:asp="#unknown">
AssociatedUpdatePanelID="UpdatePanel1"
runat="server">
<progresstemplate>
<img alt="progress" src="images/progress.gif" />
Processing...
</progresstemplate>
</asp:updateprogress>
<asp:updatepanel id="UpdatePanel1" runat="server" xmlns:asp="#unknown">
<contenttemplate>
<asp:gridview id="gvArticals" runat="server"></asp:gridview>
</contenttemplate>
</asp:updatepanel>
Note:One instance of ScriptManager is require to run the ajax controls.
For positioning the image in the gridview's center refer the following link:
http://www.w3schools.com/cssref/pr_class_position.asp[
^]
All the best.
--Amit