Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to bind the SelectedItem of a "static" ComboBox to an XmlDataProvider

$
0
0

Hi,

I have a Combo populated with values directly in the XAML file and I have to bind its SelectedItem to an XmlDataProvider.
I try this but it seems to not work..

<ComboBox DataContext="{StaticResource xmlProvider}" 
          SelectedValue="{Binding XPath='//BLOCK[@id=1]/ITEMS/ITEM[@id=2]/@value',
                          Converter={StaticResource ComboItemConverter}}"><ComboBoxItem>One</ComboBoxItem><ComboBoxItem>Two</ComboBoxItem><ComboBoxItem>Three</ComboBoxItem></ComboBox>

How can I do?

Daniele.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>