Results 1 to 4 of 4

Thread: Making a type safe collection class databindable..?

  1. #1

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616

    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
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  2. #2

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    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?
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  4. #4

    Thread Starter
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616

    *Resolved*

    There is a big old article on this on MSDN...
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width