Multiple fields sorting in a ListView?


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Cool, thanks!

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Also, just to be sure, if I set the BO.Sort in the OnLoad() of the form it will be respected everywhere the BO is used?





Yes. It will stay set until set to something else. So you should be fine.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Trent. I will go with the BO.Sort instead since I need to do some process with the BO that requires the records to be in the specified order.



Talking about the BO.Sort & BO.Filter I know that with the BO.Filter if adding new records during my process will filter out those records that does not meet the filter condition (which makes sense), so I should remove the filter then re-apply it, so in case of the BO.Sort, is there anything I should be aware of while doing my record process?



Also, just to be sure, if I set the BO.Sort in the OnLoad() of the form it will be respected everywhere the BO is used?

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Is it possible to sort a ListView by multiple columns (fields) combinations?




No. If you are going to do this then you need to sort the business object or your query coming in. If you have the need for this to be dynamic in any way, then you will need to sort the BO and repopulate the list that way versus column sorting within the list. So my point is, you can get this behavior, but not through the standard ListView column sorting....unless....you create your own column sorter, which is a possibility also.



In this case, you can just create a class that implements the System.Collections.IComparer interface (very easy) then sorts as you need. You would create an instance and set the ListViewColumnSorter property on the listview AFTER the load has already happened. This way you overwrite the base logic.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi guys,



Is it possible to sort a ListView by multiple columns (fields) combinations?



Currently I have a listview which I am adding a whole bunch of records and would like to have these be sorted specifically by a combination of columns (fields).



This ListView is getting the data via a BO.CopyDataFrom(), and I have specified the BO.Sort field property, but when adding the records to the BO and Requery() the ListView, the records are not shown properly sorted.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search