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

  • Home
  • SEARCH
  • 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 1089577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:14:36+00:00 2026-05-16T23:14:36+00:00

I have a custom control that has an Items property. I Have applied an

  • 0

I have a custom control that has an Items property. I Have applied an EditorAttribute with a UITypeEditor of type CollectionEditor.

Collection Type:

[Serializable]
[Editor(typeof(CollectionEditor), typeof(UITypeEditor))]
public class ListItemsCollection : CollectionBase
{
    // methods
}

Property Declaration In The Control:

private new ListItemsCollection _Items;

[Editor(typeof(CollectionEditor), typeof(UITypeEditor))]
public new ListItemsCollection Items
{
    get
    {
        return _Items;
    }
    set
    {
        _Items = value;

        // do other UI changes
    }
}

Problem:
When I drop this control to the designer surface, I am able to add items to the Items property using the PropertyGrid. But, the when I click the Ok button of the CollectionEditor the setter of the Items property is not getting called.

AFAIK when a value is returned from the EditValue method of a UITypeEditor class the setter block of the property is supposed to be called.

This is driving me insane. I even tried adding Event‘s to the ListItemsCollection, so that when Items are added, I can whatever I want with the control’s ui.

This is not supposed to be hard. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 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-16T23:14:36+00:00Added an answer on May 16, 2026 at 11:14 pm

    I try to reprodeuce your situation: using following code, I get a message box showing whenever I edit the list from VS property window. Beware that you have to create the list by yourself. If you don’t create it, VS create a temp list which you can edit from property window, but does not set your property to this list (so your setter will never be called)

        public UserControl1()
        {
            InitializeComponent();
            list = new BindingList<ListViewItem>();
            list.ListChanged += new ListChangedEventHandler(list_ListChanged);
        }
    
        void list_ListChanged(object sender, ListChangedEventArgs e)
        {
            MessageBox.Show(e.ListChangedType.ToString());
        }
    
        private BindingList<ListViewItem> list;
    
        public BindingList<ListViewItem> List1
        {
            get { return list; }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this has been asked a lot, but I have a server-side custom
EDIT: Original title: When I add a custom control based on a timer, my
I need a container that I can set a custom DataSource on so that
I have a simple little dialog that lets user setup a time block. The
I am adding some custom tabs to a jquery ui tab control. $(#tabs).tabs(add,#tabContent0,CLICK ME
Completely rewrote the question as I now have more information about what is happening.
I am working on an ASP.Net Mvc 3 application using FormsAuthentication with a custom
Based on some custom security settings, I alter window child controls to readonly and
To get the core question out of the way first: has anyone used the
I need to navigate forth and back in Solr results set ordered by score

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.