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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to keep a dataset sorted as the user chose.

Status
Not open for further replies.

cmn2

Programmer
Mar 6, 2003
73
0
0
US
Hi
I'm using a dataset as the datasource for a datagrid. When the dataset is displayed in the grid a user can click on any column header of the dataset to alter the sort order as they choose.

My question is... if I now want to pass the user sorted dataset and display it in another datagrid how do I keep the dataset sorted as the user choose and not how it originated from the datasource.

I hope I explained that clearly. Thank you for any help you can lend.
 
Simplest way is to use a dataview and pass that into the 2nd form. However dataviews arent great on large amounts of data


Sweep
...if it works, you know the rest..
Always remember that Google is your friend

curse.gif
 
I'm not a big fan of sorting datasets. It's kinda like sorting a database.

If you need to keep the sorting tho, you can always create a variable that maintains the last sort action performed and then just reference that when you populate the new grid. Soming like:

iSortColumn = column sorted
iSortDirection = column direction (asc = 0 or desc = 1)

Just a thought.
 
Thanks all for your replies. I'll try out the approaches you've mentioned. I appreciate your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top