[ Log In ]
Skip Navigation Links

Populating the ComboBox using LINQ to SQL and Setting the Initial Value

This was one of my most challenging controls to wrap my head around. Populating the ComboBox is straight forrward, but getting an initial or default value to be selected resulted in a lot of trial and error. Data binding does not seem to be intuitive as it is in the DataGrid. the XAML for the ComboBox uses a DataTemplate through which a StackPanel and TextBlock is arranged.

XAML Code: