Click here to Skip to main content
15,900,589 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

i have a PropertyGrid with some Propertys from my Object, and One of these Properties has a List (Like ComboBox). This Property has a StringConverter and an UITypeEditor.

The Methods of these Objects were called, and return correctly Types, also the DropDownBox ist there and i can click this an he show me the Values and so on, but i will not press the Triangle to show the values, i will click anywhere in the property to display the drop-down list via Events or so.

How i make this ?

I searched for it, but nothing possible found Frown | :(

Greetings
Lucki87
Posted
Updated 18-Jan-12 21:21pm
v3

1 solution

If the property type is an enumeration, it should work out of the box.

If it is something more sophisticated, you will have to create a custom TypeConverter[^] and override its GetStandardValuesSupported(), GetStandardValuesExclusive() and GetStandardValues() methods.

To make the displayed values usable, you will have to add overrides for CanConvertTo(), ConvertTo(), CanConvertFrom() and ConvertFrom(). They are used to convert your settings to/from the string that is displayed in the dropdown.
 
Share this answer
 
Comments
Lucki87 18-Jan-12 10:25am    
Hi lukeer,

My Property has a TypeConverter, with Values etc.
These values are displayed when i click on the triangle.

But i will the values displayed when i click on the name or the defaultValue from my Property.

Greetings
Lucki87
lukeer 19-Jan-12 3:15am    
Do your custom TypeConverter methods get called when you try to drop the list down?

Does your custom TypeConverter return the correct StandardValuesCollection?

Can you post your custom TypeConverter code (using the "Improve question" link)?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900