Home Forums WPF controls Xceed Toolkit Plus for WPF PropertyGrid editors – Unexpected warnings

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • GuglielmoCancelli
    Participant
    Post count: 19
    #44803 |

    Hi,
    I encountered a strange behaviour in the following scenario:
    I have two objects A and B that have different properties (A.BlueProperty, B.RedProperty). These properties require different editors to be represented in the PropertyGrid. The PropertyGrid properties are being initialized in code-behind as follows:

    myPropertyGrid.SelectedObject = selectedObject;
    myPropertyGrid.PropertyDefinitions = newPropertyDefinitions;
    myPropertyGrid.EditorDefinitions = newEditorDefinitions;

    Now, when I select the object A I get the “BindingExpression path error” stating that RedProperty couldn’t be found on object A (as expected, since A has BlueProperty but not RedProperty). So it seems that the PropertyGrid loads all editors at once, in spite of defining explicitly which editor to use for which selectedObject. Moreover, when switching between A and B object selection, the number of warnings increases. So after the click sequence of A-B-A-B-A, I’ll have a total of 6 (1+2+3) “BindingExpression path error” warnings for object A, suggesting again some kind of incremental addition of the editors (accordingly, I’ll also have 3 (1+2) “BindingExpression path error” warnings for not finding BlueProperty for object B).

    How could I avoid this behaviour and warnings?

    p.s. (using xceed version 3.1)

    Best wishes

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    Could you send me a simple stand alone sample project which reproduces the issue so that I could have a closer look. You may send it to: support@xceed.com

    GuglielmoCancelli
    Participant
    Post count: 19

    I just sent you a dummy project that reproduces the issue. However, after deeper inspection I realized that the issue was caused by the incorrect binding, the PropertyGrid had nothing to do with it (in my context the binding mode should have been Mode=”OneTime”).

    Thank you for your time,
    Best wishes

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.