sortedbindinglist chnage the list if values are same

sortedbindinglist chnage the list if values are same

Old forum URL: forums.lhotka.net/forums/t/7317.aspx


abhishakers posted on Wednesday, July 22, 2009

i am using sortedbinding list on my csla objects. fitrst i am applying sorting on date . after wards i am applying sorting on string.
if the string is same for all collection then also it changes the index of pervious sort.
please suggest

RockfordLhotka replied on Wednesday, July 22, 2009

SortedBindingList only sorts on one property at a time, and doesn't preserve the ordering of any previous sort when resorting.

If you want to sort on more than one property you can look at the CSLAcontrib project on CodePlex where there's a more advanced version of SortedBindingList, or use a LINQ query.

JoeFallon1 replied on Wednesday, July 22, 2009

I used the ObjectListView successfully for a few years to sort more than one property at a time. It also filters so it was a nice replacement for both Sorted and Filtered BindingList.

But once LINQ came out I switched completely to it. So depending on your version of .Net you can go either way.

Joe

 

Copyright (c) Marimer LLC