That did the trick. I can now control which items appear in the master and detail rows
');" title="Smile -
">
The xaml for my application contains:
<!-- ModelRoot is a singleton (accessible via the static/shared GetInstance method) which provides access to observable collections exposed as properties. E.g. Routes (the master rows in this case). -->
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="winRoutePlanner.xaml"
xmlns:model="clr-namespace:Dispatcher.Model;assembly=DispatcherModel" >
<Application.Resources>
<ObjectDataProvider MethodName="GetInstance" ObjectType="{x:Type model:ModelRoot}" x:Key="ModelRoot"/>
</Application.Resources>
</Application>
The window xaml contain:
<window.Resources>
<xcdg:DataGridCollectionViewSource x:Key="gridData"
Source="{Binding Path=Routes, Source={StaticResource ModelRoot}}">
<!--The Master row -->
<xcdg:DataGridCollectionViewSource.ItemProperties>
<xcdg:DataGridItemProperty Name="RouteId" Title="Route#"/>
<xcdg:DataGridItemProperty Name="RouteName" Title="Route Name"/>
</xcdg:DataGridCollectionViewSource.ItemProperties>
<xcdg:DataGridCollectionViewSource.DetailDescriptions>
<!-- "Orders" is the name of the ObservableCollection<Orders> property in the Route object-->
<xcdg:PropertyDetailDescription RelationName="Orders">
<xcdg:PropertyDetailDescription.ItemProperties>
<!--Specify detail row items here -->
<xcdg:DataGridItemProperty Name="OrderId" Title="Order#"/>
<xcdg:DataGridItemProperty Name="LocationId" Title="LocationId"/>
</xcdg:PropertyDetailDescription.ItemProperties>
</xcdg:PropertyDetailDescription>
</xcdg:DataGridCollectionViewSource.DetailDescriptions>
</xcdg:DataGridCollectionViewSource>
</Window.Resources>
I also removed the PropertyRelation from the Orders Property in the Route (Master) object. The data model now has no view references and I was able to remove the Xcdg namespace from the model. WTG.
Many thanks.