I have a SQL table which has columdns "AreaCode" and "Description" whcih is used to populate a WPF combobox. But when I select an item on the combobox it displays System.Data.DataRowView on the combobox text. Below is the xaml for the combobox.
<ComboBox x:Name="AreaComboBox" Grid.Row="3" Grid.Column="1" Width="300" Margin="5" IsEditable="True" ItemsSource="{Binding}" SelectedValuePath="Description">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="Area" Text="{Binding AreaCode}"/>
<TextBlock Text=" "/>
<TextBlock x:Name="Description" Text="{Binding Description}"/>
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
The combo box is filled using a simple c# code: AreaComboBox.ItemsSource = dataSet.Area.AsDataView();
What I noticed was that this is not a problem if I change IsEditable to False, this is only a problem when its true.
Can someone please help me figure out why its returning "System.Data.DataRowView" rather that the text of the item I selected? Would be even better if there is a solution :)
I am more than happy to provide more details.