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

BindingMode not TwoWay when using AutoBindBehavior and struct Property

1 Answer 25 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 13 May 2016, 11:49 PM

For a given property of type Vector3 (struct). If I set a custom EditorAttribute on the property, the binding with the custom editor's Value will be properly set to TwoWay:

[Editor(typeof(Vector3Editor), "Value")]
public Vector3 Position
{
    ...
}

If on the other hand use a DataTemplateSelector on the property grid (to avoid having to specify the Editor attribute on every Vector3 property) with the AutoBindBehavior in the DataTemplate, the binding will be OneWay. Looking in ILSpy (PropertyGridEditorFactory.GetBindingMode) it looks to only support TwoWay with primitive types.

I would expect the same BindingMode whether I use the EditorAttribute or a DataTemplateSelector with the AutoBindBehavior.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 18 May 2016, 11:08 AM
Hi,

Indeed, you are right. There are some cases where TwoWay mode returned by this method, results in multiple errors. However, we will review those cases and will try to make the behavior consistent to the one from EditorAttribute. Please keep in mind that this would be complicated and I can not guarantee a specific time frame.

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PropertyGrid
Asked by
Guy
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or