DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    BigDave Guest

    Lose Custom Collection In UserControl


    I am losing items in a custom collection in a usercontrol I have written.

    I have created a usercontrol called DockMaster which holds dock-areas I have
    set up on the main form (e.g. top, bottom, left etc.).

    Dockmaster has a property called DockPositions which is actually a custom
    collection (collection class). The collection class holds individual dockpositions
    (another user control).

    I can add dockpositions to dockmaster at design time. All seems fine. The
    control renders correctly on the form.

    When I close the form that holds dockmaster, and then re-open it, my collection
    is gone. But the controls still exist in the dockmaster container, i.e.
    I can still change the properties of individual dockpositions (by clicking
    on them inside dockmaster on the form) - but when I go to the dockpositions
    collection (accessed from the default properties form) it is empty.

    Anyone have any ideas that may help? I have found it really difficult to
    find help on component authoring for DotNet.

  2. #2
    Patrick Steele [MVP] Guest

    Re: Lose Custom Collection In UserControl

    In article <3c6756be$1@10.1.10.29> (from BigDave <david@sst.net.au>),
    >
    > I am losing items in a custom collection in a usercontrol I have written.
    >
    > I have created a usercontrol called DockMaster which holds dock-areas I have
    > set up on the main form (e.g. top, bottom, left etc.).
    >
    > Dockmaster has a property called DockPositions which is actually a custom
    > collection (collection class). The collection class holds individual dockpositions
    > (another user control).


    Are your DockPositions collection along with the individual objects it
    holds serializable? I'm not positive on this, but I believe the
    settings are saved by serializing them. If they're not serializable,
    they won't get saved.

    --
    Patrick Steele
    Microsoft .NET MVP

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links