Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
582
Binding the Label of a Cell to a ComboBox.SelectedValue
posted

Hi all! 

To bind a textblock to a ComboBox Id would normally write the following:

<TextBlock Text="{Binding SelectedValue, ElementName=CB1}" />

However, if I move this binding to a FieldLabel instead, it does not work:

<igDP:Field Name="Price" Label="{Binding SelectedValue, ElementName=CB1}"  > 

Output says someting like "the property Name couldn't bind since the element it's trying to bind to is null":

How should I write my binding for this to work?

 

  • 6867
    posted

    As explained in this thread, a Field is not in the element tree, so it cannot use ElementName bindings.  That thread shows how to use my DataContextSpy utility class to set up a binding on a Field's property.

    Josh