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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:14:20+00:00 2026-05-11T13:14:20+00:00

I am using a PropertyGrid to show properties from my objects. However, I’m also

  • 0

I am using a PropertyGrid to show properties from my objects. However, I’m also allowing the user to create their own properties, and set values for these custom properties. Each object that can have these custom properties has a Dictionary collection, where the string is a unique key to identify the property, and Object is the value of a primitive type (string, bool, int etc..)

I’ve created a custom PropertyDescriptor with get and set methods that check the Dictionary for a matching key, or create/overwrite the value with a matching key respectively.

However, I also want to give the user the ability to clear the property, and thus remove its entry from the dictionary entirely. I’d put the code to to this in the ResetValue override method of my custom PropertyDescriptor, however I don’t see any way through the PropertyGrid interface to envoke this? It doesn’t seem to be a context menu option or something obvious like that.

So if I have a custom PropertyDescriptor with a custom ResetValue method, how do I actually evoke that method from a PropertyGrid?

  • 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. 2026-05-11T13:14:21+00:00Added an answer on May 11, 2026 at 1:14 pm

    I think the easiest way to achieve this is to add a contextmenu to your property grid, with a menu item ‘Reset’, and then handling its click event like this:

    private void resetToolStripMenuItem_Click(object sender, EventArgs e) {                             PropertyDescriptor pd = propGrid.SelectedGridItem.PropertyDescriptor;     pd.ResetValue(propGrid.SelectedObject); } 

    I think Visual Studio does something like this.

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

Sidebar

Related Questions

I'm using a PropertyGrid to show custom properties that are exposed through the implementation
I'm using a WinForms property grid to display the properties of an object. However,
I am using a PropertyGrid for configuring objects. I need to be able to
I'm using the PropertyGrid control from DevExpress in multiple forms. I have a ImageComboBoxEdit
I'm using PropertyGrid control for editing some objects in my application. I'm using custom
When using the PropertyGrid and passing in an Object for the user to make
Using JDeveloper , I started developing a set of web pages for a project
Using C#, I need a class called User that has a username, password, active
I'm using PropertyGrid to edit an object containing a collection. Collection is edited using
I'd like to edit a list of key value(string, string) items using a propertygrid.

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.