troubleshooting Question

Combo Box won't display data from database correctly

Avatar of KevinJoeBadger
KevinJoeBadgerFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft SQL ServerC#
19 Comments10 Solutions438 ViewsLast Modified:
combo-issue.docx

See attached screen dump
Although I have attached this combo to a table ok and I can select any account in the drop down the combo itself refuses to display the selected item?

However I resize it makes no difference.

Any Ideas?

This is XAML for combo box

       <ComboBox AllowDrop="False" DataContext="{Binding}" Height="23" IsEnabled="True" IsSynchronizedWithCurrentItem="True" ItemTemplate="{StaticResource AccountTemplate}"     ItemsSource="{Binding}" Margin="0,13,14,0" Name="AccountsList"     VerticalAlignment="Top" SelectionChanged="AccountsList_SelectionChanged"     HorizontalAlignment="Right" Width="576">

This is data template

<Window x:Class="VirginOneAccount.AccountInfo"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Account Information" Height="410" Width="874" Loaded="Window_Loaded" Closed="Window_Closed" Name="AccountsForm" WindowStartupLocation="CenterScreen" Initialized="AccountsForm_Initialized">
    <Window.Resources>
        <DataTemplate x:Key="AccountTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=AccountName}"/>
            </StackPanel>
        </DataTemplate>

As you can imgaine I am fairly new to c#
ASKER CERTIFIED SOLUTION
Gautham Janardhan

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 10 Answers and 19 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 10 Answers and 19 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros