This question is locked. New answers and comments are not allowed.
This is my XAML code
<Grid x:Name="LayoutRoot"> <Grid.Resources> <financial:Financial_Account_Types x:Key="FinancialAccountTypes"/> </Grid.Resources> <sdk:DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" Margin="112,83,0,0" Name="financialAccountDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="400"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn x:Name="accountDescriptionColumn" Binding="{Binding Path=AccountDescription}" Header="Account Name" Width="SizeToHeader" /> <sdk:DataGridTextColumn x:Name="accountNumberColumn" Binding="{Binding Path=AccountNumber}" Header="Account Number" Width="SizeToHeader" /> <sdk:DataGridTemplateColumn x:Name="financialAccountTypeIdColumn" Header="Account Type" Width="SizeToHeader"> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding ListFinancialAccountType, Source={StaticResource FinancialAccountTypes},Mode=TwoWay}" SelectedValue="{Binding FinancialAccountTypeId, Mode=TwoWay}" DisplayMemberPath="AccountTypeName" SelectedValuePath="FinancialAccountTypeId" /> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> </sdk:DataGrid.Columns> </sdk:DataGrid> </Grid>This is my Code Behind
public partial class Financial_Accounts : Page { public Financial_Accounts() { InitializeComponent(); } // Executes when the user navigates to this page. protected override void OnNavigatedTo(NavigationEventArgs e) { FinancialAccountContext financial_ctx = new FinancialAccountContext(); financial_ctx.Load(financial_ctx.GetFinancialAccountsQuery()); financialAccountDataGrid.ItemsSource = financial_ctx.FinancialAccounts; } } public class Financial_Account_Types : ObservableCollection<FinancialAccountType> { public EntitySet<FinancialAccountType> ListFinancialAccountType { get { FinancialAccountContext financial_ctx = new FinancialAccountContext(); financial_ctx.Load(financial_ctx.GetFinancialAccountTypesQuery()); return financial_ctx.FinancialAccountTypes; } } }