Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4063690
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:45:31+00:00 2026-05-20T15:45:31+00:00

I have a datagrid, which is bound to a RIA data object. this datagrid

  • 0

I have a datagrid, which is bound to a RIA data object. this datagrid was created by dragging and dropping the table from the datasources tab within Visual Studio. the datagrid works fine.

I have added an extra column, on which I have added a Combobox via a DataGridTemplateColumn. this combobox is bound to a domaindatasource. However the combobox does not contain any data.

I took the combobox code from XAML, and pasted it as a seperate control outwith the datagrid, and the combobox works fine and displays data.

Why does my combobox not display any data when included within a datagrid? My XAML code is as follows:

<navigation:Page x:Class="Chemical_Management_System.EditPermissions" 
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
       mc:Ignorable="d"
       xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
       d:DesignWidth="640" d:DesignHeight="480"
       Title="EditPermissions Page" Width="640" HorizontalAlignment="Center" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" xmlns:my="clr-namespace:Chemical_Management_System.Web" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
<Grid x:Name="LayoutRoot">
    <Border BorderBrush="Silver" BorderThickness="1" Height="45" HorizontalAlignment="Left" Margin="10,10,0,0" Name="Border1" Style="{StaticResource HeaderBackground}" VerticalAlignment="Top" Width="618">
        <TextBlock Height="23" Name="TextBlock21" Style="{StaticResource HeaderText}" Text="Edit Permissions" />
    </Border>
    <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:Permissions, CreateList=true}" Height="0" Name="PermissionsDomainDataSource" QueryName="GetPermissionsQuery" Width="0">
        <riaControls:DomainDataSource.DomainContext>
            <my:DataContext />
        </riaControls:DomainDataSource.DomainContext>
    </riaControls:DomainDataSource>

    <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:PermissionLookups, CreateList=true}" Height="0" Name="PermissionLookupsDomainDataSource" QueryName="GetPermissionLookupsQuery" Width="0">
        <riaControls:DomainDataSource.DomainContext>
            <my:DataContext />
        </riaControls:DomainDataSource.DomainContext>
    </riaControls:DomainDataSource>

    <sdk:DataGrid AutoGenerateColumns="False" Height="366" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=PermissionsDomainDataSource, Path=Data}" Margin="12,61,0,0" Name="PermissionsDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="615">
        <sdk:DataGrid.Columns>
            <sdk:DataGridCheckBoxColumn x:Name="DeputyColumn" Binding="{Binding Path=Deputy}" Header="Deputy" Width="SizeToHeader" />
            <sdk:DataGridTextColumn x:Name="DescriptionColumn" Binding="{Binding Path=Description}" Header="Description" Width="SizeToHeader" />
            <sdk:DataGridTextColumn x:Name="IDColumn" Binding="{Binding Path=ID, Mode=OneWay}" Header="ID" IsReadOnly="True" Width="SizeToHeader" />
            <sdk:DataGridTextColumn x:Name="PermissionIDColumn" Binding="{Binding Path=PermissionID}" Header="Permission ID" Width="SizeToHeader" />
            <sdk:DataGridCheckBoxColumn x:Name="PrimaryColumn" Binding="{Binding Path=Primary}" Header="Primary" Width="SizeToHeader" />
            <sdk:DataGridTextColumn x:Name="UserIDColumn" Binding="{Binding Path=User.Name}" Header="User" Width="SizeToHeader" />


            <sdk:DataGridTemplateColumn Header="Permission">

                <sdk:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <ComboBox Height="23" HorizontalAlignment="Left"  Name="ComboBox1" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Data, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue='',ElementName=PermissionLookupsDomainDataSource}" >
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Description}" />
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </DataTemplate>
                </sdk:DataGridTemplateColumn.CellTemplate>
            </sdk:DataGridTemplateColumn>


        </sdk:DataGrid.Columns>
    </sdk:DataGrid>

    <ComboBox Height="23" HorizontalAlignment="Left" Margin="194,446,0,0" Name="ComboBox1" VerticalAlignment="Top" Width="120" ItemsSource="{Binding Data, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue='',ElementName=PermissionLookupsDomainDataSource}" >
        <ComboBox.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Description}" />
            </DataTemplate>
        </ComboBox.ItemTemplate>
    </ComboBox>
</Grid>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:45:32+00:00Added an answer on May 20, 2026 at 3:45 pm

    I believe the problem is occurring because a DataTemplate lives in its own DataContext, and isn’t able to access parent elements, including your DomainDataSource. Its quite a frustrating problem that I’ve run into as well.

    These links helped point me in the right direction:

    SO Question

    Creating a Silverlight DataContext Proxy to Simplify Data Binding in Nested Controls

    If you’re not opposed to using code behind, I believe the stackoverflow solution of setting the ItemSource on the Loaded event will be the easiest fix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataGrid , which is bound to a DataTable object. The user
In Silverlight 4 I have a DataGrid which is bound to a RIA DomainDataSource,
I have a datagrid which is bound to a database table. I need to
I have a datagrid which is bound to a table. I have a field
I have a DataGrid which is being bound dynamically to a database query. The
Scenario I have a DevExpress DataGrid which is bound to a DataSet in C#.
I have a wpf datagrid which is bound to an observable collection. Currently I
I have a silverlight datagrid which is bound to a PagedCollectionView displaying a collection
I have a View that displays a DataGrid which is bound to an ObservableCollection
I have a DataGrid in my WPF window which is bound to a database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.