This is the XAML:
<ListView.View>
<GridView>
<GridViewColumn DisplayMemberBinding="{Binding Path=ScenarioName}" Header="Scenario Name" />
<GridViewColumn DisplayMemberBinding="{Binding Path=ScenarioType}" Header="Scenario Type" />
<GridViewColumn Header="Well names" Width="175">
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<ItemsControl ItemsSource="{Binding Path=Wells}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<!--<TextBlock Text="{Binding}"/>-->
<Button Width="60" Margin="0 0 0 3">Test 1</Button>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding Path=StartPeriod}" Header="Start period" />
<GridViewColumn DisplayMemberBinding="{Binding Path=EndPeriod}" Header="End period" />
<GridViewColumn DisplayMemberBinding="{Binding Path=Lagged}" Header="Lagged" />
<GridViewColumn DisplayMemberBinding="{Binding Path=Detrended}" Header="Detrended" />
<GridViewColumn DisplayMemberBinding="{Binding Path=MinimumMonths}" Header="Length of continuous months" />
<GridViewColumn DisplayMemberBinding="{Binding Path=CorrelatedWells}" Header="Correlated wells" />
<GridViewColumn Header="Excluded Wells">
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<ItemsControl ItemsSource="{Binding Path=ExcludedWells}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
And it looks like:
http://tinypic.com/view.php?pic=xpse8n&s=6
The questions is whether there is an easy to group the “Test1” buttons under Well names(in groups of,let say, 5 items) because the volume of well names can be quite big and neither horizontal nor vertical wrapping helps.
many thanks,
elias
Well you can always add a new property to your ViewModel
and change your ItemsSource binding to use this instead.
Example here on MSDN