|
-
Apr 14th, 2003, 03:00 AM
#1
Thread Starter
Frenzied Member
Making a type safe collection class databindable..?
I have a usercontrol and one of it's members is a type safe collection (inherited from CollectionBase.DictionaryBase).
Now I want this collection to be bindable (read-only) to a datagrid. I have added the attribute <Bindable()> to the property and implemented IListSource in the control and returned this list from GetList() overloaded function but it doesn't show up in the datagrid's bindings.
What step(s) am I missing?
Thanks in advance,
Duncan
-
Apr 15th, 2003, 03:29 AM
#2
Thread Starter
Frenzied Member
OK - I added an interface to IBindableList and now my control shows up in the DBGrid Databindings list OK - but when bound the grid doesn't get the column information from the collection's base class. How do I expose this?
-
Apr 15th, 2003, 04:22 AM
#3
It should just use reflection and use the properties as columns, but if you want to change this or if it isn't working you may try implementing ITypedList or ITypeList (can't remember which it is) which has like 2 methods that expose how the column names are retrieved.
-
Apr 16th, 2003, 08:19 AM
#4
Thread Starter
Frenzied Member
*Resolved*
There is a big old article on this on MSDN...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|