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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:27:14+00:00 2026-06-04T01:27:14+00:00

I have a problem with propertygrid not displaying the parent value of an expandable

  • 0

I have a problem with propertygrid not displaying the parent value of an expandable property for multiple objects (using propertygrid.SelectedObjects)

[Browsable(true), TypeConverter(typeof(ExpandableObjectConverter))]
 public class MyNestedClass {
    private int a;
    private int b;

   [Browsable(true), 
    ReadOnly(false), 
    RefreshProperties(RefreshProperties.Repaint),
    NotifyParentProperty(true)]
   public int A {
      get { return this.a; }
      set { this.a = value; }
   }

   [Browsable(true), 
    ReadOnly(false), 
    RefreshProperties(RefreshProperties.Repaint),
    NotifyParentProperty(true)]
   public int B {
      get { return this.b; }
      set { this.b = value; }
   }


   public MyNestedClass(int a, int b) {
      this.a = a;
      this.b = b;
   }


   public override string ToString() {
      return this.a.ToString() + “; “ + this.b.ToString();
   }
}

This class is part of another class myClass, where myNestedClass is defined as a browsable property within.

public class MyClass {
   …
   private MyNestedClass myNestedClassObject;
   …
   [Browsable(true),
    ReadOnly(false), 
    MergableProperty(true),
    RefreshProperties(RefreshProperties.Repaint)]
   public MyNestedClass MyNestedClassObject {
      get { return myNestedClassObject; }
      set { myNestedClassObject = value; }
   }
   …
}

Everything is working fine, when only one instance of class myClass is displayed in the propertygrid.
The propertygrid shows:

…
MyNestedClassObject | 1; 2
   A                | 1
   B                | 2
…

In the case I’m trying to display an array of MyClass instances (via propertygrid.SelectedObjects), where myNestedClass objects do have the same values for a and b, I only see something like this in the propertygrid:

…
MyNestedClassObject |
   A                | 1
   B                | 2
…

I know that the propertygrid is designed to show only common properties of multiple objects, what’s true for the subproperties a and b. But why the so called “typeconverter” (or parent) line of the expandable properties do have an empty value portion, although the subproperties a and b are the same for all objects?

Can anybody shed a bit of light on that and/or can help me on this issue?

Many thanks in advance

Jochen

  • 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-06-04T01:27:16+00:00Added an answer on June 4, 2026 at 1:27 am

    After more research on that issue I found the solution thanks to another stackoverflow article:

    PropertyGrid mult. controls select, null exception on property set?

    The author had the same issue with expandable properties when multiple objects are selected where all properties are common to all instances. The “typeconverter” (or parent) line stayed empty, on the other hand subproperties are shown.

    He noticed to override method Equals in the class whose instances are displayed in the property grid.
    And yes, that’s it.

    Many thanks to greggorob64 !

    with kind regards

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

Sidebar

Related Questions

I have problem with getting value of parameter when I have variable with some
I have problem with Uploadify: I log in the project using: FormsAuthentication.SetAuthCookie(myName, false); Then,
I have problem when i using ListView and Linq as datasource. The error down:
I have problem with customizing each page using pagecontrol and UIScrollView. I'm customizing Page
I have a PropertyGrid in my application that is used for editing arbitrary objects.
I have a problem with WCF seemingly not including attributes such as Category when
I'm using PropertyGrid control for editing some objects in my application. I'm using custom
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem with consuming DbContext class in EF 4.3 CodeFirst approach. As for
I have problem with building in Qt4 creator. I have some created projects and

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.