Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sorting IList on demand

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
Happs



Joined: 13 Jul 2011
Posts: 62
Location: Sydney, Australia

PostPosted: Sat Mar 17, 2012 1:01 am    Post subject: Sorting IList on demand Reply with quote

I have created a control that inherits from VirtualTree, datasource implements IList interface, virtual tree loads on demand as scroll down.

I need to implement column sort and need your advice/confirmation about best approach.

I had a look at the FileBrowser example where I can see the example override OnGetRowData & GetChildrenForRow.

Do I need to do same or any other approch you recommend?

I would prefer to sort visible items on virtual tree as it can have thousands of items displayed. Just to give you an example:

Virtual tree load 100 items, when 'Name' column clicked, I would like to sort 100 items by name. User can scroll down to load more items, I would like to load new items and sort accordingly.

Thank you.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Mar 20, 2012 2:35 am    Post subject: Reply with quote

Sorting just the displayed items is likely to be highly confusing for the user. I don't know of any other control that works that way. Normally when you sort items you expect it to affect the ordering of all items as you scroll. Say if I'm sorting by name and it shows me 3 items with names starting with "A" then most users would expect that means there are only 3 items in the entire list start with "A". They wouldn't expect to scroll down and suddenly find another 4.

Sorting can be an expensive operation for very large collections. In this case you should probably consider using a database and leveraging the sorting facilities that this provides. Databases are able to provide reasonably efficient sorting mechanism because they maintain indexes that speed this up.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Happs



Joined: 13 Jul 2011
Posts: 62
Location: Sydney, Australia

PostPosted: Tue Mar 20, 2012 2:49 am    Post subject: Reply with quote

Thanks for your response Smile

My initial test also confirm better performance to sort data before displaying to virtual tree.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group