"Bart Mermuys" wrote:
> Hi,
>
> "JohnC" <quellar@comunity.nospam> wrote in message
> news:81E2DA62-CDD7-47D4-A02C-FEF2F9ADCBAD@microsoft.com...
> >I am using the SortableBindingList<T> class described in the MSDN Custom
> >Data
> > Binding article at
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms11162004.asp?frame=true
> >
> > This business object is displayed in a listbox using databinding via a
> > BindingSource oject. When I set the Sort property on my BindingSource
> > object
> > and then modify the underlying data I get an exception from the
> > BindingSource's BuildSortString. This same exception was documented on the
> > microsoft forums at
> >
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=76499 without a
> > resolution. Is this a bug in .NET 2.0 or is there some other problem?
>
> I think it is caused by some missing overrides in SortableBindingList<T> :
>
> * Add two fields:
> private PropertyDescriptor _sortProp = null;
> private ListSortDirection _sortDir = ListSortDirection.Ascending;
>
> * Add code inside ApplySortCore:
> after "_isSorted=true" put :
> _sortProp = property
> _sortDir = direction
>
> after "_isSorted=false" put:
> _sortProp = null
>
> * Add two more overrides:
> protected override PropertyDescriptor SortPropertyCore
> {
> get { return _sortProp; }
> }
>
> protected override ListSortDirection SortDirectionCore
> {
> get { return _sortDir; }
> }
>
>
>
> HTH,
> Greetings
>
>
>
> >
> > Thanks,
> > John
> >
>
>