Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 281671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:13:24+00:00 2026-05-12T05:13:24+00:00

Actually i wrote a UserControl which acts as a container for other (let’s call

  • 0

Actually i wrote a UserControl which acts as a container for other (let’s call it) NestedUserControls.

I implemented a programmatically way to add such NestedUserControls to my UserControl (through an App(string name) function). But what i actually more like would be some kind of List as a public property for my UserControl.

But the problem is, that my NestedUserControl needs to be put into the private UserControl.panel.Controls list. Within my own written Add() function, this is no big problem. But how can i accomplish this problem when i use the List<NestedUserControl> property? I don’t get any informations about, when the list changes in any way.

The only idea i actually found would be to create some kind of EventList<> which throws an event whenever the list gets changed. So would this be the ‘right’ way or do you have any better approaches (or maybe there exists already some kind of EventList within .Net framework??

Oh, before i forget: I’m using VS2008, C#, WinForms, .Net 3.5 SP1

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:13:24+00:00Added an answer on May 12, 2026 at 5:13 am

    So to get more clearity within this problem, here my solution:

    What i’d liked to do was, adding a List to my UserControlContainer, which can be easily changed at run-time or design-time. To get it correctly to work on design-time, i had to inherit from CollectionBase instead of List<> and added the DesignerSerializationVisibility(DesignerSerializationVisibility.Content) attribut. The CollectionBase itself provides some events for Insert, Remove and Clear.

    After implementing these functions and adding firing of a my own defined event ListChangedEvent to the outer world, i was able to get informations about any list change.

    The only problem you’ll have, is that the CollectionEditor won’t delete any objects from your list. Instead it seems to work with a second internal list. After hitting ok, your list will be cleared and filled up with the other events. So don’t miss to handle the CollectionBase.OnClear or CollectionBaseOnClearComplete functions!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a wrapper around Image_Graph bar charts. I actually wrote the
Actually, I'm using this way. Do you have a better way? private bool AcceptJson(HttpRequest
I wrote this simple piece of code(it actually calculates sine, cosine or tangent values
I'm working on a simple download manager wrote in Cocoa and actually I use
Actually I wrote a Java program for calculating a particular number on the Fibonacci
I wrote a quick program in python to add a gtk GUI to a
I wrote a multi-threaded program which does some CPU heavy computation with a lot
This is a weird one. Long story short: wrote a usercontrol using AJAX. Used
Is there a way to universally force a page to error when a usercontrol
I wrote an IE plugin using MFC activex. The plugin actually creates a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.