|
-
September 5th, 2006, 04:57 AM
#1
Dynamically sorting collection classes: How to do?
Hi out there,
I have several collection classes that contain Data from a database.
I need to add a .sort method for each of them, where I dynamically pass the property to be sorted and the sort-direction (ASC / DESC).
For example lets assume I'd have a collection class with employees, and I want to sort it by name and (in another step) by age.
now I would like to do something like this:
cEmployees.sort("Name", "DESC")
cEmployees.sort("BirthDate", "ASC")
Now the first problem is that it seems that the collections (built with the class builder utility of VB) do not contain a properties collection, though all of them "have" properties. And If I try to implement it myself, I can't do properties.add. Very strange.
I really would like to write the method in a way that I could just copy and paste the method to each class, as the projekct contains more than 50 collection classes ...
Can anyone help with this?
have a nice day
Patzer
_____________________________
Philo will never be forgotten
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|