ComboBox & GetStandardValues always returns string values

Grids for WPF Forum

Posted 14 years ago by John Kelly

I have a typeConverter that returns a list of 'MyType' objects in the StandardValuesCollection. However when i select an item in the list box it always returns a string item and not the 'MyType' object itself. I've looked at the messages that are returned from ConvertFrom and ConvertTo and the destination type is always of type system.string.

I've tried using
'<propgrid:PropertyEditor ValueTemplateKey="{x:Static propgrid:BuiltinEditors.DynamicValueTemplateKey}" PropertyType="{x:Type local:MyType}" />'
as well as other ideas but when i select an item the property grid combobox it always returns a string value.

Am i mising something simple here?

Thanks in advance

John K.

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Hi John,

If you can please email over a small sample project, then we can take a look for you. One thing to keep in mind though, is if your TypeConverter.GetStandardValuesExclusive returns false then the dynamic property editor will allow the user to enter text. This means it will be using the ComboBox.Text property, versus the ComboBox.SelectedItem property.

Actipro Software Support

Posted 14 years ago by John Kelly
That was it. I'm an idiot ;)

Many thanks..

The latest build of this product (v22.1.4) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.