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 6609071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:40:36+00:00 2026-05-25T19:40:36+00:00

I am trying to incorporate a property grid control with a class that has

  • 0

I am trying to incorporate a property grid control with a class that has a list/collection of another class as one of the properties. Lets call them class A and the list would be containing class B for reference.

I was wanting to incorporate a form that had two list boxes. The list box on the left would contain a list of all of class B’s in my program that are not currently in the list on the right. The list on the right would contain all of the class B’s that are currently associated with class A. I want buttons in between to move items between the two lists.

This would be easy to design, but I’m not sure exactly how to set up the form to be used as the collection editor.

Can anyone point me in the right direction?

And also, how can I go about having setting up a drop down for a property that contains a list of id’s to select from if anyone could point me in the direction for accomplishing this as well.

  • 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-25T19:40:37+00:00Added an answer on May 25, 2026 at 7:40 pm

    Okay, I was finally able to track down how to accomplish this.

    I was attempting to create a custom CollectionEditor.CollectionForm which was close to what I needed to do, but it wasn’t quite the right direction.

    First of all, create a regular Windows Form which includes your GUI for editing your collection. Then just include button/buttons which return a DialogResult in the Form.

    Now the key to accomplishing what I was looking for is not a CollectionEditor.CollectionForm as I had thought would be the correct approach, but rather a UITypeEditor.

    So, I created a class that inherited from the UITypeEditor. Then you simply flesh it out as such:

    public class CustomCollectionModalEditor: UITypeEditor
    {
        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            if (context ==null || context.Instance == null)                
                return base.GetEditStyle(context);
    
            return UITypeEditorEditStyle.Modal;
        }
    
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService editorService;
    
            if (context == null || context.Instance == null || provider == null)
                return value;
    
            editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
    
            CForm CollectionEditor = new CForm();
    
            if (editorService.ShowDialog(CollectionEditor) == System.Windows.Forms.DialogResult.OK)
                return CollectionEditor.Programmed;
    
            return value;
            //return base.EditValue(context, provider, value);
        }
    }
    

    The key parts to take note of, are the functions GetEditStyle and EditValue. The part responsible for firing-off the Form you created to edit your collection, is in the EditValue override function.

    CForm is the custom collection editor form I designed in this test to edit the collection. You need to fetch the IWindowsFormsEditorService associated with the IServiceProvider and simply call the .ShowDialog(formVariable) of the IWindowsFormsEditorService in order to show the form you designed to edit the collection. You can then catch the returned DialogResult value from your Form and perform any custom handling that you require.

    I hope this helps someone out as it took me quite a bit of digging to determine the right way to incorporate this.

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

Sidebar

Related Questions

I've been trying to incorporate the lessc compiler in a large project that has
I am trying to create a drop down list that incorporates database data and
Hi I'm developing an Android app and trying to incorporate maps into one of
Trying to use code from here Im trying to incorporate both classes so that
I was trying to incorporate a functionality in my ASP.NET such that a DIV
I'm trying to incorporate this yui drop down menu control in a web page:
I am trying to incorporate a silverlight object in one of my controller's views
I am trying to incorporate a splice such that it tests for 2 things:
Trying to incorporate the missed call log in my windows phone mango application. Is
I have a Android Actionscript project that I am trying to incorporate sound in,

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.