*Experts* Merrion Posted April 14, 2003 *Experts* Posted April 14, 2003 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 Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
*Experts* Merrion Posted April 14, 2003 Author *Experts* Posted April 14, 2003 Hmm - maybe I should replace IListSource with IBindingList...shall check when I get home. Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
*Experts* Merrion Posted April 15, 2003 Author *Experts* Posted April 15, 2003 OK - I was on the wrong track with IListSource - It should have been IBindableList...now the Datagrid binds to the list but it doesn't know anything about the data type within the collection - how do I do that part? Quote Printer Monitor for .NET? - see Merrion Computing Ltd for details
Leaders quwiltw Posted April 15, 2003 Leaders Posted April 15, 2003 Implement the Add Sub, Create Method, and Item Property with you're datatype in mind. So, for the Item property, you'll do something like this: Default Property Item(ByVal key As String) As MySpecificDataType Get Return CType(Dictionary.Item(key), MySpecificDataType) End Get Set(ByVal Value as MySpecificDataType) Dictionary.Item(key) = Value End Set End Property Quote --tim
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.