Hi,
I have a grid and paging, filtering enabled. I use client-side databinding and client-side history management. When I run grid, paging and filtering works fine, but when I push browsers back button problem begins.
To see the problem lets look at history.
1 - first load; pageindex = 0, filter = ""
2- push next page button; pageindex = 1, filter =""
3- filter (lets say age column "age < 21"); pageindex = 0 (this is normal, item count changed [27] and pager must be on first page), filter="age < 21"
4- now push back button, pageindex 1, filter ="" read by history control, PageMethods.GetData(dyanmicLinqQuery, sortExpressions.toString(), pageindex, pagesize, updateGrid, webServiceCallFailed) called, and desired data / item count [1152] returns with pageindex=1, and filter="". So I can set mastertableview's pageindex and pager will show "Page 2 of x" which is ture (step 2, pageindex=1). Now updateGrid event fired
now it comes to line set_virtualItemCount with itemcount of 1152. set_virtualItemCount internally compares previous item count [27] with current one [1152]. If there is a difference then it calls page(0) method and sets pageindex 0 (actually this could be normal for any other scenarios), and this call also fires my RadGrid1_Command which hits datacontext again. And at the end, pageindex=0 (but must be 1 according to step 2), and there is 2 datacontext hits.
So how can I by-pass page(0) event which fired by set_virtualItemCount internally?
Thanks in advance
PS: I am using Q1 2009
I have a grid and paging, filtering enabled. I use client-side databinding and client-side history management. When I run grid, paging and filtering works fine, but when I push browsers back button problem begins.
To see the problem lets look at history.
1 - first load; pageindex = 0, filter = ""
2- push next page button; pageindex = 1, filter =""
3- filter (lets say age column "age < 21"); pageindex = 0 (this is normal, item count changed [27] and pager must be on first page), filter="age < 21"
4- now push back button, pageindex 1, filter ="" read by history control, PageMethods.GetData(dyanmicLinqQuery, sortExpressions.toString(), pageindex, pagesize, updateGrid, webServiceCallFailed) called, and desired data / item count [1152] returns with pageindex=1, and filter="". So I can set mastertableview's pageindex and pager will show "Page 2 of x" which is ture (step 2, pageindex=1). Now updateGrid event fired
function updateGrid(result) { |
tableView.set_dataSource(result.Data); |
tableView.set_virtualItemCount(result.rowCount); |
tableView.dataBind(); |
} |
now it comes to line set_virtualItemCount with itemcount of 1152. set_virtualItemCount internally compares previous item count [27] with current one [1152]. If there is a difference then it calls page(0) method and sets pageindex 0 (actually this could be normal for any other scenarios), and this call also fires my RadGrid1_Command which hits datacontext again. And at the end, pageindex=0 (but must be 1 according to step 2), and there is 2 datacontext hits.
So how can I by-pass page(0) event which fired by set_virtualItemCount internally?
Thanks in advance
PS: I am using Q1 2009