Link to home
Start Free TrialLog in
Avatar of bhermer
bhermer

asked on

Datagrid NextPrev and NumericPages in PagerStyle

Hi,

I have a datagrid control on a page and I would like to use both Next & Previous and Numeric pages:

< 1 2 3 4 5 >

It wont let me use both, any ideas? I understand I could probably develop a custom pager but I would prefer not to if possible.
ASKER CERTIFIED SOLUTION
Avatar of Elvio Lujan
Elvio Lujan
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bhermer
bhermer

ASKER

Thought that may be the answer, but I was hoping someone could think around this, I will leave open for a while to see, but I presume I would to do something like:

On my PageIndexChanged event multiply the page index by my per page count, redo my SQL to say something like

dim StartRecord as integer = ((e.NewPageIndex * 10) - 10)
dim EndRecord as integer = (e.NewPageIndex * 10)

"SQL = "SELECT "  & StartRecord & " TO " & EndRecord  & ",* FROM table WHERE field=value"

But the trouble is "SELECT 1 TO 10" doesnt work. Any idea how to return 10 rows with SQL and and specify the starting point?