I have my data model in my ASP.NET website and what i'm attempting to do is retrieve tbl_company records and bind these to a datagrid in silverlight - pretty simple.
I set up my database so tbl_company has a foreign key (company_scope_id) that is linked to tbl_company_scope. From tbl_company_scope I basically want to show the column "scope". My code in silverlight is below:
<data:DataGrid x:Name="dgCompanies" Grid.Row="0" AutoGenerateColumns="False">
<data:DataGrid.Columns>
<data:DataGridTemplateColumn>
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding name, Mode=TwoWay}"></TextBlock>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
<data:DataGridTemplateColumn>
<data:DataGridTemplateColumn.CellTemplate >
<DataTemplate>
<TextBlock Text="{Binding CompanyScope.scope}"></TextBlock>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
</data:DataGrid.Columns>
</data:DataGrid>
(all the naming etc etc is correct but basically "scope" will not show when I bind to the datagrids ItemSource)
Does anyone know how you're ment to show the scope column in the datagrid?
Cheers