BindingMode not TwoWay when using AutoBindBehavior and struct Property

2 posts, 0 answers
  1. Guy
    Guy avatar
    16 posts
    Member since:
    Mar 2012

    Posted 13 May 2016 Link to this post

    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.


  2. Yoan
    Yoan avatar
    1128 posts

    Posted 18 May 2016 Link to this post


    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.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top