Exposing a type safe collection for data binding
-
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(True) 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 '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
-
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(True) 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 '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
It trurns out I should have implemented IBindableList not IListSource. Now the datagrid lists my control as a source in the DataBindings but it doesn't show any columns - I take it it doesn't know what the type safe collection type looks like? How do I add property descriptions to my existing class so the data bound grid can pick them up? '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
-
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(True) 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 '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd
It turns out I should have implemented IBindableList not IListSource. Now the datagrid lists my control as a source in the DataBindings but it doesn't show any columns - I take it it doesn't know what the type safe collection type looks like? How do I add property descriptions to my existing class so the data bound grid can pick them up? '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd