PropertyGrid - attaching UITypeEditor without using Editor attribute?


Dr. Proctor


I have a PropertyGrid in my app that displays set of properties that
is created dynamically at run-time. Ie. I use a collection that
implements ICustomTypeDescriptor and it's instance is bound to
PropertyGrid's SelectedObject.

This collection stores PropertyDescriptor-derived objects, which are
the actual properties being edited. I would like to add custom
UITypeEditor for properties with certain custom datatypes. But I can't
use Editor attribute, because the properties are created dynamically.

Is there a switch case somewhere deep in the WinForms library that
binds certain datatypes, like System.Drawing.Color, to a specific
UITypeEditor? What I'd like to do is to override and extend this
functionality with my own types.

Thanks in advance.

Bob Powell [MVP]

OTTOMH you may be able to use the ICustomTypeDescriptor interface to create
attributes for the dynamic properties such as the editorattribute...

This isn't something I've tried though as the generation of dynamic
attributes seems a bit esoteric.

Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks

Answer those GDI+ questions with the GDI+ FAQ

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
Mar 30, 2015
Reaction score
How to edit Custom Control propertygrid.
For example :
public Thickness ControlBorderThickness


return _borderThickness;
set { _borderThickness = value;OnPropertyChanged("ControlBorderThickness"); }
i want to use propertygrid.doubleupdown control instead of default editor

in above image......Border thickness has default editor thickness..but i want to use doubleupdown instead of 2,2,,2


  • upload_2015-3-30_17-26-53.png
    45.6 KB · Views: 554
  • upload_2015-3-30_17-27-15.png
    45.6 KB · Views: 406
  • upload_2015-3-30_17-40-31.png
    147.5 KB · Views: 475

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question