I bound standard ListBox to ObservableCollection<XmlDataProvider>, then set:
<ListBox ItemTemplate="{StaticResource SimpleDataTemplate}">
"SimpleDataTemplate" is defined as follows:
<DataTemplate x:Key="SimpleDataTemplate" DataType="XmlDataProvider">
<DockPanel Name="mdockElementHolder">
<igDP:XamDataGrid DataSource="{Binding XPath=//Elements/Element}"
AutoFit="True"
GroupByAreaLocation="None"
ScrollingMode="Immediate"
RecordLoadMode="PreloadRecords"
RecordContainerGenerationMode="PreLoad"
CellContainerGenerationMode="PreLoad">
...
I also implemented manual field layout of XamDataGrid:
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout Key="Key_Elements" >
<igDP:FieldLayout.Settings>
<igDP:FieldLayoutSettings DataRecordCellAreaStyle="{StaticResource TopItemRecordCellAreaStyle}">
<igDP:FieldLayoutSettings.DataRecordCellAreaGridTemplate>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="250" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
</Grid>
</ItemsPanelTemplate>
</igDP:FieldLayoutSettings.DataRecordCellAreaGridTemplate>
</igDP:FieldLayoutSettings>
</igDP:FieldLayout.Settings>
<igDP:FieldLayout.Fields>
<igDP:Field Name="Name" Label="NAME" Column="0" Row="0" DataType="{x:Type sys:String}">
</igDP:Field>
<igDP:Field Name="DataType" Label="TYPE" Column="1" Row="0" DataType="{x:Type sys:String}">
<igDP:Field Name="IsSelected" Label="Is Selected" Column="1" Row="1" DataType="{x:Type sys:String}" Visibility="Hidden">
<igDP:Field Name="IsSortBy" Label="Is Sort By" Column="0" Row="1" DataType="{x:Type sys:String}">
<igDP:Field Name="Description" Label="DESCRIPTION" Column="0" Row="3" ColumnSpan="2" DataType="{x:Type sys:String}">
<igDP:Field Name="Condition" Label="Condition" Column="2" Row="0" RowSpan="3" DataType="{x:Type sys:String}">
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
Form constructor instantiates ObservableCollection and adds few XmlDataProviders.
Problem arises when this form is shown. Only first ListBoxItem contains properly formatted XamDataGrid. All other ListBoxItems show blank XamDataGrid.
What am I doing wrong?
Thank you