C propertygrid not updating
If not, changing the attribute at runtime that way will wrongly modify the attributes of every property of the class." What is important is to have a static definition of the readonly property not for every property but only for the interested property (in this case Country). If not, changing the attribute at runtime that way will wrongly modify the attributes of every property not only for the class but the WHOLE APPLICATION since a the modification affect a private static Hashtable _default Attributes of the Attribute Collection class.
hello bros, Your work is so great, I have do some similar work before.
In order to utilize the property grid attributes in Table 1, we need to import the namespace for these attributes so we add the using clause for the System.
Component Model: All that is left to do to get the grid running is assign an instance of our customer class to the property grid.
This code shows how to add Read Only Attribute at runtime.
However, your property grid will be void of descriptions, categories and other niceties that property grids such as Visual Studio. In order to really make your property grid soar, you need to add special attributes to each of your properties. Component Model namespace and are shown in the table below: Now we are ready to create our customer class to make it displayable in the property grid.
For example, a Date of Birth property (of type Date Time) of the customer will allow you to edit the value of the the date with the calendar control.