I'm using WPF with net 3.5 to load the ItemsSource of a combo box from an
xml file.
The xml is setup like this:
<profiles>
<profile>
<profilename>First profile</profilename>
...
</profile>
... other profile nodes
</profiles>
In the Windows.Resources node of the xaml I have:
<XmlDataProvider x:Key="xmldata" Source="c:/temp/xmlData.xml"
XPath="profiles/profile" />
and in the combobox I have:
<ComboBox Margin="5" Name="cbProfiles" Width="240" IsEditable="True"
ToolTip="Select database profile"
VerticalContentAlignment="Center"
ItemsSource="{Binding Source={StaticResource xmldata},
XPath=profilename }" SelectedIndex="0" />
But this only retreives the first profile-profilename for the combobox list.
If I change the XPath of the combobox to //profilename, then I get them all.
What am I not understanding about how this works since I think the XPath of
the XmlDataProvider should be providing a list of <profiles/profilenodes
and then the XPath of the combobox should give me all the <profilename>
nodes.
Regards,
Rick