Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IBindingList interface
Message
From
16/01/2007 19:04:33
James Hansen
Canyon Country Consulting
Flagstaff, Arizona, United States
 
 
To
16/01/2007 17:25:10
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Object Oriented Programming
Environment versions
Environment:
VB.NET 1.1
Miscellaneous
Thread ID:
01186106
Message ID:
01186127
Views:
19
Mike,

Try this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms02182005.asp

I know it is more about BindingList than IBindingList, but rather than implementing IBindingList directly, it is easier to inherit from this generic class and let it do a lot of the work. That's what I finally did and it was a lot easier. (There are certainly easier things to use to learn about interfaces! That's a tough one.)

As the article describes, I just had to override a bunch of IBindingList properties and methods in my class: SupportsSortingCore, IsSortedCore, SortDirectionCore, SortPropertyCore, ApplySortCore, RemoveSortCore. I also had to invoke the sort on the Items collection of the class (the items have to implement the IComparable interface) from ApplySortCore appropriately and notify the bound controls that something has changed by invoking the OnListChanged method.

Hope that helps.

...Jim

>So I am trying to learn about OOP, but I am stuck on interfaces. I understand what they are and what they are used for, but i am having problems actually IMPLEMENTING them. For example, I have a Collection class which I want to bind to a datagrid, which I can do using the IBindingList interface, but now I want to implement sorting and I am having a hard time finding good examples. All the "simple" examples I can find are good, but don't show how to implement sorting.
>
>Does anybody know of a good website/book/etc. that tells all about interfaces and gives good examples?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform