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

textboxes won't populate

$
0
0

Related to a previous question of mine in this forum, I am using the following without success to populate TextBoxes that should display fields related to a ComboBox.

<TextBox Name="txtCompany" Grid.Row="4" Grid.Column="1" HorizontalContentAlignment="Left"
Grid.ColumnSpan="2" Template="{StaticResource TBT}"
Text="{Binding ElementName=cboCustomer, Path=SelectedValuePath}" />

I've tried a number of alternatives to SelectedValuePath. Any help would be appreciated. I would prefer to get the values directly from the database through the index or selected value stated in the ComboBox.

For your convenience, following is the XAML code for the ComboBox, along with a partial listing of the XML database:

<ComboBox x:Name="cb" Grid.Row="1" Grid.Column="1" Height="30" Width="350" SelectedIndex="0" HorizontalAlignment="Left" Margin="0,10" 
                ItemsSource="{Binding Source={StaticResource dataProvider}, 
		        XPath=/CompanyName}" 
	  	        DisplayMemberPath="CompanyName"></ComboBox>

<?xml version="1.0" encoding="utf-8" ?><NorthWind><Customers><CustomerID>ALFKI</CustomerID><CompanyName>Alfreds Futterkiste</CompanyName><ContactName>Maria Anders</ContactName><ContactTitle>Sales Representative</ContactTitle><Address>Obere Str. 57</Address><City>Berlin</City><PostalCode>12209</PostalCode><Country>Germany</Country><Phone>030-0074321</Phone><Fax>030-0076545</Fax></Customers><Customers><CustomerID>ANATR</CustomerID><CompanyName>Ana Trujillo Emparedados y helados</CompanyName><ContactName>Ana Trujillo</ContactName><ContactTitle>Owner</ContactTitle><Address>Avda. de la Constitución 2222</Address><City>México D.F.</City><PostalCode>05021</PostalCode><Country>Mexico</Country><Phone>(5) 555-4729</Phone><Fax>(5) 555-3745</Fax></Customers>
...</NorthWind>





Viewing all articles
Browse latest Browse all 18858

Trending Articles



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