How do I create custom collections that can be bound to comboboxes?

D

Don

I've been trying to create a custom collection that can be bound to a
combobox via the DataSource property, but I can't seem to get it to work.
I've created a class that implements IList, and it seems to work okay on its
own, but when I try to bind it to a combobox, the combobox doesn't show
anything (and it starts having problems repainting itself). The Datasource
appears to contain my custom collection object, but when I ask for its item
count I receive zero when I should be receiving a higher number.

Has anyone tried to do something like this before and succeeded? Maybe
there's just a problem with my implementation of IList? I can post my code
(it's long) or email it if anyone wants to see it.

- Don
 
D

Don

Okay, I followed the instructions for creating a class based on
CollectionBase. It now binds to a combobox, but the combobox just shows the
class name instead of the value the ToString property returns for each
object. What's up with that?

- Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top