ASP.NET - append dataset gridview when scroll
Asked By msakt on 17-May-12 07:27 AM
in my table have 5000 record,using sp i fetch value and store dataset then bind to gridview...its take more time
now i want reduce time..first bind 1000 record to gridview when scroll down another 1000 bind.....and another 1000 etc..
how?
Jitendra Faye replied to msakt on 17-May-12 07:29 AM
YOu if you have more records then you can go for paging concept.
You can implement paging in GridVIew.
For this use this code-
For your solution check these things-
1. First Check
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//bind your Grid here
}
}
2. set AllowPaging Property of GridView to True.
3. Write following code in PageIndexChanging() event of GridView-
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
//bind your Grid here
}
Follow this steps and let me know.