locked
ListView Header Bind to ComboBox RRS feed

  • Question

  • Hi,

    How can I bind the Header of a Column of a ListView to the selected value of a ComboBox?

    <GridViewColumn Header="Abono" Width="100" DisplayMemberBinding="{Binding Path=ImporteMovimiento}"/>
    Instead of "Abono" I want to display the value of the selected item in a ComboBox.


    G
    Tuesday, September 29, 2009 6:58 PM

Answers

  • Hello Giber,

    Try this:

    Header = "{Binding ElementName=yourComboName, Path=SelectedValue}"


    Goodl Luck.
    • Marked as answer by Giber Tuesday, September 29, 2009 9:01 PM
    Tuesday, September 29, 2009 7:40 PM

All replies

  • Hello Giber,

    Try this:

    Header = "{Binding ElementName=yourComboName, Path=SelectedValue}"


    Goodl Luck.
    • Marked as answer by Giber Tuesday, September 29, 2009 9:01 PM
    Tuesday, September 29, 2009 7:40 PM
  • Can you not data bind the selected item of the combo box and the header to the same source? E.g.

    <GridViewColumn Header={Binding Path=CurrentItem} />
    
    <ComboBox SelectedItem={Binding Path=CurrentItem} />
    Tuesday, September 29, 2009 7:41 PM