views:

48

answers:

0

I have a custom configuration tool for an application that uses the .Net PropertyGrid control.

The classes underneath have Color properties that are edited in the grid. If I don't decorate the attributes at all I get a drop down colour picker that lets me choose Windows system colours.

However this is for a web site, so I want hexadecimal colour codes. I can specify these with a type converter:

[TypeConverter(typeof(WebColorConverter))]
public Color Background { ...

This fixes the input from RGB to hex, but the drop down stays as a list of Windows system colours - like this:

What I have

In Visual Studio when dealing with web controls I get a modal pop up with a hexagonal colour selector instead.

What I want

I want to get the modal web colour editor rather than the windows forms variant.

However, I looked at System.Web.UI.WebControls colour properties and they just specify the TypeConverter - they don't specify a UITypeEditor.

Anyone know how to get the same editor as the web controls?