PropertyGrid bug?

J

Javier Campos

Hi all,

Maybe this has been said before, I'm sorry if it has.

I'm making a custom EnumConverter for a propertygrid so it shows other
values than the named values of the enum... this works pretty much
correctly, and as expected, EXCEPT:

When doubleclicking the dropdown box, moving the mouse wheel, or using an
accelerator key for the dropdown, it ignores completely the ConverTo()
function (which is called when the dropdown is popped up and a value
selected), and just doesn't call it. This is a problem as I use this
function to convert the string representation to the actual enum value, so
the setter receives an string and it causes an invalid property value
exception (and doesn't change the value, that is).

I could surely make every setter check if it's a string and convert
accordingly, but that'd be hell of a lot of work (i'm doing this for many
different enums and properties), and that'd rather ruin the usefulness of
the PropertyGrid.

So is this a bug in the PropertyGrid, am I doing something worng, or is
there something I have forgotten to do so I can convert to my enum value
when the editor value is changed other than popping up the dropdown?

If you need further explanation, let me know

Thanks,

Javier Campos
 

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

Top