This is a migrated thread and some comments may be shown as answers.

TypeConverter is not working

1 Answer 225 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 27 Feb 2020, 02:56 PM

Hello,

 

I have followed your WPF example: 

public class PlayerTypeConverter : TypeConverter
{
    public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
    {
        return true;
    }
 
    public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
    {
        return true;
    }
 
    public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
    {
 
        return new StandardValuesCollection(new string[] { "Mark Wright", "Ian Rush", "John Barnes",
               "Paul Ince", "Jamie Redknapp", "Sami Hyypia", "Steven Gerrard ", "Jordan Henderson" });
    }
}

and attached the converter to my property:

/// <summary>
/// Sets the algorithm that is available for the mode.
/// </summary>
[Category("Reconstruction")]
// [Editor(typeof(AlgorithmEditor), typeof(UITypeEditor))]
[Telerik.Windows.Controls.Data.PropertyGrid.Editor(typeof(ComboBox))]
[TypeConverter(typeof(AlgorithmConverter))]
[Description("Sets the algorithm that is available for the mode.")]
public string Algorithm
{
    get => GetProperty<string>();
    set => SetProperty(value);
}

 

 

 

Unfortunately when setting the property to the PropertyGrid the combobox does not show up.

The type converter is not even used. Originally I had the PropertyInspector which is still active until I have transitioned to the RadPropertyGrid, here the TypeConverter is used without any problems.

What could be the problem?

 

Thanks

Martin

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 03 Mar 2020, 09:47 AM

Hello Martin,

Do you use PropertyGrid's PropertySet feature? If yes, be advised that PropertySet mode has some limitations. We have the attributes support request logged in our system. You follow it to track our progress on the following feedback item.

If that is not the case, may I ask you to share more information about your set up? Generally, it would be great if you can isolate the problem in a sample project. Then you can send it to me for further investigation.

Regards,
Yoan
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PropertyGrid
Asked by
Martin
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or