I am wanting to use a cookie to remember the grid page number so when users go to a detail page and then come back it will remember the page number the grid was on. I have the code below to read the cookie, but I am not sure when in the grid life cycle I should set the CurrentPageIndex. Thanks in advance.
if
(CookieUtilities.HasCookieItemValue(
"crl"
,
"PGN"
))
{
int
result;
if
(
int
.TryParse(CookieUtilities.GetCookieItemValue(
"crl"
,
"PGN"
),
out
result))
{
if
(rgSalesCallList_SalesCallReportList.PageCount > result)
{
rgSalesCallList_SalesCallReportList.CurrentPageIndex = result;
}
else
{
rgSalesCallList_SalesCallReportList.CurrentPageIndex = rgSalesCallList_SalesCallReportList.PageCount - 1;
}
}
}