Trying to implement a multi-level table of competitions. 5 judges give marks to each participant in two speeches in 2 categories.
The scores are displayed via the Grid, but the Name, the total score and the average score are in separate columns.
XAML markup:
<ListView Name="DGMain" ScrollViewer.CanContentScroll="False" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.PanningDeceleration="10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="4" Grid.Column="0" > <ListView.View> <GridView> <GridView.Columns> <GridViewColumn Header="Имя"> <GridViewColumn.CellTemplate> <DataTemplate> <Label VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Style="{DynamicResource CellStyle}" Content="{Binding Path=Name, Mode=OneWay}"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn Header="Баллы"> <GridViewColumn.CellTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Label Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" Content="1" Style="{DynamicResource CellStyle}"/> <Label Grid.Column="0" Grid.Row="2" Grid.RowSpan="2" Content="2" Style="{DynamicResource CellStyle}"/> <Label Grid.Column="1" Grid.Row="0" Content="Техника:" Style="{DynamicResource CellStyle}"/> <Label Grid.Column="1" Grid.Row="1" Content="Презентация:" Style="{DynamicResource CellStyle}"/> <Label Grid.Column="1" Grid.Row="2" Content="Техника:" Style="{DynamicResource CellStyle}"/> <Label Grid.Column="1" Grid.Row="3" Content="Презентация:" Style="{DynamicResource CellStyle}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="2" Grid.Row="0" Text="{Binding Path=P1.PointsT[0], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="3" Grid.Row="0" Text="{Binding Path=P1.PointsT[1], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="4" Grid.Row="0" Text="{Binding Path=P1.PointsT[2], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="5" Grid.Row="0" Text="{Binding Path=P1.PointsT[3], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="6" Grid.Row="0" Text="{Binding Path=P1.PointsT[4], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="2" Grid.Row="1" Text="{Binding Path=P1.PointsP[0], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="3" Grid.Row="1" Text="{Binding Path=P1.PointsP[1], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="4" Grid.Row="1" Text="{Binding Path=P1.PointsP[2], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="5" Grid.Row="1" Text="{Binding Path=P1.PointsP[3], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="6" Grid.Row="1" Text="{Binding Path=P1.PointsP[4], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="2" Grid.Row="2" Text="{Binding Path=P2.PointsT[0], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="3" Grid.Row="2" Text="{Binding Path=P2.PointsT[1], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="4" Grid.Row="2" Text="{Binding Path=P2.PointsT[2], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="5" Grid.Row="2" Text="{Binding Path=P2.PointsT[3], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridTStyle}" Grid.Column="6" Grid.Row="2" Text="{Binding Path=P2.PointsT[4], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="2" Grid.Row="3" Text="{Binding Path=P2.PointsP[0], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="3" Grid.Row="3" Text="{Binding Path=P2.PointsP[1], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="4" Grid.Row="3" Text="{Binding Path=P2.PointsP[2], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="5" Grid.Row="3" Text="{Binding Path=P2.PointsP[3], Mode=OneWay}"/> <TextBox Style="{DynamicResource GridPStyle}" Grid.Column="6" Grid.Row="3" Text="{Binding Path=P2.PointsP[4], Mode=OneWay}"/> </Grid> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn Header="Среднее"> <GridViewColumn.CellTemplate> <DataTemplate> <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> <TextBox Style="{DynamicResource GridOverallStyle}" Text="{Binding Path=P1.Middle, Mode=OneWay}"/> <TextBox Style="{DynamicResource GridOverallStyle}" Text="{Binding Path=P2.Middle, Mode=OneWay}"/> </StackPanel> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn Header="Сумма"> <GridViewColumn.CellTemplate> <DataTemplate> <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> </Grid.ColumnDefinitions> <TextBox VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="0" Style="{DynamicResource GridOverallStyle}" Text="{Binding Path=P1.Overall, Mode=OneWay}"/> <TextBox VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" Style="{DynamicResource GridOverallStyle}" Text="{Binding Path=P2.Overall, Mode=OneWay}"/> </Grid> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> </GridView.Columns> </GridView> </ListView.View> </ListView>
The result is the following:
As you can see in the photo, the name, average and total points are not in the center ... I would like the cell for the score and the average score to occupy as much space as the entire column takes for the performance ... But, since they are in different elements, I find it difficult to suggest how this can be done (if at all possible)
Could you tell me how to do this?