Ok, I am using a datagrid with paging enabled.

It works fine if number of pages is 10 or less.

Where I am running into problem is if there are more than 10 pages


An example:
paging looks like this

Pages 1 2 3 4 5 6 7 8 9 10 ....


when I click on the .....

i get

.... 4 5 6 7 8 9 10 11 12 13

when I click on any of the links, it goes to the wrong page (off by 2), in other words, if i click on 4 it goes to 2 if i click on 10, it goes to 8

any ideas?