Luis,
My guess is you need to use ICustomTypeDescriptor together with your own
class that inherit from PropertyDescriptor. PropertyDescriptor's protected
constructor allows you to pass an array of attributes for this property.
This thread might get you started:
http://discuss.develop.com/archives/...S&P=R4310&I=-3
Out of curiosity, why can't you apply attributes at compile time?
HTH,
Alexander
"Luis Arvayo" <am**********@prodigy.net.mx> wrote in message
news:Oy**************@TK2MSFTNGP10.phx.gbl...
Is there some way to attach an editor to a property of a class at runtime
?
Ex.;
public class MyClass
{
[Editor(typeof(ImageEditor),typeof(UITypeEditor)]
public int BitmapIndex
{
get {...}
set {...}
}
}
Instead of defining statically before compile time, I need to define the
editor at runtime in order to be used together with the PropertyGrid. Is
tha possible ?
Thanks
Luis A.