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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:00:58+00:00 2026-05-25T18:00:58+00:00

Is there any way to change propertygrid griditem behavior in runtime? What I need

  • 0
  1. Is there any way to change propertygrid griditem behavior in runtime? What I need is I have one property say “Education”, if user selects “Masters” then the next griditem will show education related to master in dropdown control. If user selects “Others” in Education then next control will be textbox type to take user’s input. I know how to show dropdown control, only I need how I can toggle these two control based on user selection.

  2. One more question, is there any way to set griditem property “Browsable” to false/true in runtime?

Is this possible?

  • 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-25T18:00:59+00:00Added an answer on May 25, 2026 at 6:00 pm

    Since your after sample code, something like the following should get you started:

    //Represents each property to show in the control, required since 
    //PropertyDescriptor is declared abstract
    public class MyPropertyDescriptor : PropertyDescriptor
    {
      public MyPropertyDescriptor(string name, Attribute[] attrs) : base(name, attrs)
      {
      }
    }
    
    //This is the class that is bound to the PropertyGrid. Using 
    //CustomTypeDescriptor instead of ICustomTypeDescriptor saves you from 
    //having to implement all the methods in the interface which are stubbed out
    //or default to the implementation in TypeDescriptor
    public class MyClass : CustomTypeDescriptor
    {
       //This is the property that controls what other properties will be 
       //shown in the PropertyGrid,  by attaching the RefreshProperties 
       //attribute, this will tell  the PropertyGrid to query the bound 
       //object for the list of properties to show by calling your implementation
       //of GetProperties 
       [RefreshProperties(RefreshProperties.All)]
       public int ControllingProperty { get; set; }
    
       //Dependent properties that can be dynamically added/removed
       public int SomeProp { get; set; }
       public int SomeOtherProp { get; set; }
    
       //Return the list of properties to show 
       public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
       {
          List<MyPropertyDescriptor> props = new List<MyPropertyDescriptor>();
    
          //Insert logic here to determine what properties need adding to props
          //based on the current property values
    
          return PropertyDescriptorCollection(props.ToArray());
       }
    }
    

    Now when you bind an instance of MyClass to the PropertyGrid, your implementation of GetProperties will be called which gives you the opportunity to determine what properties you want to show by populating the property collection accordingly.

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

Sidebar

Related Questions

Is there any way to change Firefox system icon (the one on the left
Is there any way to change the composite mode of a UIView background say
Is there any way to change the syntax highlighting of one particular file in
Is there any way to change the user's profile picture using the graph api?
Is there any way to change a connection string programatically? I mean user can
Is there any way to change the default font (Portable User Interface) used by
Is there any way to change the default tab size in a .NET RichTextBox?
Is there any way to change the ownership and permission mask for a semaphore
Is there any way to change the entire width of the horizontal scroll bar
Is there any way to change the autonumber field to a number datatype, when

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.