ASP.NET - problem in paging
Asked By Shashikala on 11-Nov-11 07:14 AM
am using a devexpress gridcontrol. after loading a data into the gridcontrol. when i click on page index to check the next page data in a devexpressgridcontol all the loaded data is going to clear. what is the solution for this.
Anandh Ramanujam replied to Shashikala on 11-Nov-11 07:16 AM
Can u pls post ur code...
dipa ahuja replied to Shashikala on 11-Nov-11 07:17 AM
After paging Rebind the gridview again
//paging code
Re-bind griview
Jitendra Faye replied to Shashikala on 11-Nov-11 07:20 AM
Bind GridView agin in PageIndexChanging() event.
Like this-
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
//bind your Grid here
}
amala mandarapu replied to Shashikala on 11-Nov-11 08:37 AM
hi,
bind gridview again in pageindexchanging() event it works.
protected void Gridview 1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
try
{
Gridview 1.PageIndex = e.NewPageIndex;
if (ddlEmployee.SelectedValue != string.Empty)
{
FillGridBySearch();
}
else
{
FillGridView(Session["EmployeeID"].ToString());
}
}
catch (Exception ex)
{
if (log.IsErrorEnabled)
{
log.Error(ex.Message);
}
}
}