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

[BREAKING CHANGE]PropertyDefinition's Binding property is now of type BindingBase

1 Answer 51 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 13 Mar 2013, 04:19 PM
Hi,
    With this new breaking change how would I achieve the following that worked before this change.
e.PropertyDefinition.Binding.Converter = new Classes.NumberToBooleanConverter();
e.PropertyDefinition.EditorTemplate = GetCheckBoxDataTemplate(e.PropertyDefinition.Binding.Path.Path);

Setting the converter and accessing the binding.Path
Thanks
Paul

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Ivanov
Telerik team
answered on 13 Mar 2013, 05:07 PM
Hello,

As BindingBase is a base type for Binding, you can check whether the e.PropertyDefinition.BInding is Binding and upcast it, like this:
if(e.PropertyDefinition.Binding is Binding)
(e.PropertyDefinition.Binding as Binding).Converter = 
new Classes.NumberToBooleanConverter();
Basically the autogenerated binding are always of type Binding so direct cast should be safe. We have changed the property type to be BindingBase in order to add support for Multibinding and PriorirtyBinding in WPF and since we maintain common codebase for both platforms we had to change it in SL too.

Greetings,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PropertyGrid
Asked by
Paul
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or