Skip to content

How to fix the title of the Collection Editor for the custom control in NET Core? #14049

Open

Description

@BhaskarSuresh22

Environment

Visual Studio Professional 2022 - version 17.14.19

.NET version

.NET 8.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

No

Issue description

When using the default CollectionEditor for a property that is a collection of System.Windows.Forms.Control-derived types, the editor window's title is displayed incorrectly. Instead of showing a title based on the collection's item type (e.g., "MyChildControl Collection Editor"), it displays the internal proxy type name: "ControlProxy`1 Collection Editor".

Image

Sample - CustomControl_Sample.zip

Steps to reproduce

  • Open the sample.
  • Add the child items for the MyParentControl using the ChildItems property.
  • Notice the Collection Editor's title is "ControlProxy`1 CollectionEditor" instead of "MyChildControl CollectionEditor".

Diagnostics


Activity

  1. added
    untriaged
    on Nov 14, 2025
  2. removed
    untriaged
    on Mar 10, 2026
  3. LeafShi1 commented on May 15, 2026

    @LeafShi1
    Member
  4. ViktoriiaUran commented on Oct 14, 2026

    @ViktoriiaUran

    The same problem also affects non-control items: the fix in #14375 only unwraps ControlProxy<T>, but plain objects and structs show ObjectProxy1 and StructProxy1 in the Collection Editor caption.

    Environment

    • Visual Studio 18.0
    • .NET 10 (works correctly in .NET Framework 4.8)

    Scenario
    A collection item (edited via a custom server-side CollectionEditor) has a nested property that is an array, edited with the default Collection Editor:

    public class Settings
    {
        public MyPoint[] Points { get; set; }
    }
    
    public struct MyPoint
    {
        public float Value { get; set; }
        public Color Color { get; set; }
    }

    Actual behavior

    1. Array of structs: caption is StructProxy1 Collection Editor. In addition, clicking Add fails with
      InvalidArgument=Value of '-1' is not valid for 'index'. Parameter name: index
      (the new item is never created, so the list box selects index -1).
    2. After replacing the array element type with a class (via a custom PropertyDescriptor), Add works, but the caption is ObjectProxy1 Collection Editor.

    Expected behavior
    Caption shows the real item type name (MyPoint Collection Editor), and Add works for struct items, as in .NET Framework 4.8.

    Screenshots
    .NET Framework 4.8
    Image

    .NET 10
    Image

    Suggestion
    Could the caption fix in #14375 unwrap any generic proxy type (ObjectProxy<T>, StructProxy<T>, ControlProxy<T>) to its underlying type rather than only ControlProxy<T>?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions