Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting & custom paging in datagrid using stored procedure 2

Status
Not open for further replies.

xtremeLogic

Programmer
Dec 19, 2003
53
CA
Hi,

I would like to implement a bi-directional (asc / desc) sorting feature on the columns of my datagrid as well as have custom paging. I have looked at many code samples out there and they just have basic examples of the built-in functionality, nothing customized.

I would like to have a custom paging solution which looks like this:

(this Label keeps track of the document numbering)
"Showing 1 - 10 of XXX Documents"
(and these are the navigation links which show page numbers)
<<Prev 1 2 3 4 5 ... Next>>

I would also like to be able to click on any column in the datagrid and sort it ascending and by clicking it again, sort it descending.

I am using VB.NET with stored procedures to populate the datagrid.

I would greatly appreciate it if anyone can show me how to get this done.

Thanks

 
Hi xtreme

This is a big subject and there is a lot of code and decisions to be made behind what you are asking for. Somebody may have time to create and post an example for you to use here but there are masses out there.

This is something I have had to tackle a number of times at work in varying incarnations and it's not been too tricky.

MSDN and 4guys between them have some pretty handy articles on this subject which should get you underway...


(probably same M$oft code as above)

(start of the 4guysfromrolla series on datagrids covers both paging and sorting)

(a very recent article on dynamic order bys in stored procedures - very useful for sorting datagrids)

Hopefully that should get you started and cover most of the issues you come across.

Good luck and enjoy

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top