Can't see ComboBox Items bound to XmlDataProvider

I have a ComboBox bound to an XmlDataProvider. The drop down looks like it has all the rows but the items aren't visible. Can anyone help me with this?

<XmlDataProvider x:Key="CodeTableCache" XPath="/perform_batch_result">
<x:XData>
<perform_batch_result>
<tabular_select_result result_name="req_status">
<row>
<attr>
<name>req_status.occurrence_type</name>
<value>R</value>
</attr>
<attr>
<name>req_status.req_status</name>
<value>TEST4</value>
</attr>
</row>
</tabular_select_result>
</perform_batch_result>
</x:XData>
</XmlDataProvider>

<ComboBox x:Name="request__req_status" DisplayMemberPath="attr[name='req_status.req_status']/value">
<ComboBox.ItemsSource>
<Binding Source="{StaticResource CodeTableCache}" XPath="tabular_select_result[result_name='req_status']/row"/>
</ComboBox.ItemsSource>
</ComboBox>

[1210 byte] By [RodYager] at [2007-12-22]
# 1

OK. I found the problem myself. It seems that the Binding tag with the Xpath needs an @ sign in front of the xml attribute 'result_name'. That's wierd because the DisplayMemberPath doesn't need an @ sign in front of 'name'. Here is the correct syntax...

<ComboBox x:Name="request__req_status" Grid.Row="2" Grid.RowSpan="1" Grid.Column="2" Grid.ColumnSpan="1" DisplayMemberPath="attr[name='req_status.req_status']/value">

<ComboBox.ItemsSource>

<Binding Source="{StaticResource CodeTableCache}" XPath="tabular_select_result[@result_name='req_status']/row"/>

</ComboBox.ItemsSource>

</ComboBox>

Rod
RodYager at 2007-8-30 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2
That is the expected behavior. XPath expressions require the '@' symbol before an attribute name, but not for elements.
JoshSmith at 2007-8-30 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified