CSLA .NET
Vibrant discussion about CSLA .NET and using the framework to build great business applications.
Sign in
|
Join
|
Help
Home
Forums
Store
FAQ
Forums
»
CSLA .NET Framework
»
CSLA .NET discussion
»
Sorting a SortedBindingList
CSLA .NET Resources:
CSLA .NET home page
Frequently Asked Questions
Download CSLA .NET
CSLAcontrib project
Code generation index
Sorting a SortedBindingList
rated by 0 users
This post has 0 Replies | 1 Follower
Posts
1
Reply
dgoldin
Posted: Wed, Sep 26 2007 6:30 AM
rated by 0 users
Hello,
I have a small question concerning sorting a SortedBindingList using the mechanisms the WPF CollectionView offers.
I try to sort it with the following "official" approach:
ICollectionView cv = CollectionViewSource.GetDefaultView(_poiList.ItemsSource);
SortedBindingList<PointOfInterest> sbl = (SortedBindingList<PointOfInterest>)_poiList.ItemsSource;
sbl.ApplySort(sortBy, direction);
cv.Refresh();
Unluckily it has no effect at all.
Is there a different way of doing this using WPF mechanisms without calling ApplySort() on the list directly (this is actually my current workaround, but not very elegant since I do grouping using GroupDescriptions)?
The CollectionView Refresh() method calls on RefreshOverride of the BindingListCollectionView method, which in turn calls on ConvertSortDescriptionCollection, also contained in the BindingListCollectionView class, which does the following:
ITypedList internalList = this.InternalList as ITypedList;
if (internalList != null) {
// more conditions and somewhen a call an ApplySort()
}
Any idea why it checks whether the list implements ITypedList? As far as I understand its not relevant for sorting but for DataBinding itself. The MSDN documentation for
ITypedList
states that one either needs to implement a ITypedList or to use a strongly typed Item in the List which is given by the use of generics if I understand correctly.
Is this a known issue? Why does SortedBindingList does not implement ITypedList?
Thanks a lot in advance,
Dimitri
Previous
|
Next
Page 1 of 1 (1 items) |
RSS
Copyright (c) 2006-2010
Marimer LLC
. All rights reserved.
Email admin@lhotka.net for support.