<Grid Grid.Row="2" Margin="15">
                <Grid.RowDefinitions>
                    <RowDefinition Height="50"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <TextBlock Margin="15 0 0 0" VerticalAlignment="Center" Text="Standard Table Design" FontSize="22" Foreground="#959595"/>

                <DataGrid Grid.Row="1" Background="Transparent" HeadersVisibility="Column"
                          AutoGenerateColumns="False" CanUserAddRows="False"
                          VerticalGridLinesBrush="Transparent" HorizontalGridLinesBrush="WhiteSmoke"
                          BorderThickness="0" ItemsSource="{Binding GridModelList}">
                    <DataGrid.ColumnHeaderStyle>
                        <Style TargetType="DataGridColumnHeader">
                            <Setter Property="BorderThickness" Value="0"/>
                            <Setter Property="VerticalAlignment" Value="Center"/>
                            <Setter Property="HorizontalContentAlignment" Value="Center"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="Foreground" Value="#959595"/>
                            <Setter Property="FontWeight" Value="Bold"/>
                            <Setter Property="Height" Value="35"/>
                        </Style>
                    </DataGrid.ColumnHeaderStyle>

                    <DataGrid.RowStyle>
                        <Style TargetType="DataGridRow">
                            <Setter Property="Height" Value="40"/>
                            <Setter Property="Foreground" Value="#959595"/>
                            <Setter Property="HorizontalAlignment" Value="Center"/>
                            <Setter Property="HorizontalContentAlignment" Value="Center"/>
                        </Style>
                    </DataGrid.RowStyle>

                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Name" Width="*"  Binding="{Binding Name}"   ElementStyle="{StaticResource ContentStyle}" />
                        <DataGridTextColumn Header="Email" Width="*" Binding="{Binding Email}"    ElementStyle="{StaticResource ContentStyle}" />
                        <DataGridTextColumn Header="Address" Width="*"     Binding="{Binding Address}"    ElementStyle="{StaticResource ContentStyle}" />
                        <DataGridTextColumn Header="UserType" Width="*"    Binding="{Binding UserType}"  ElementStyle="{StaticResource ContentStyle}"   />

                        <DataGridTemplateColumn Header="Level" Width="*">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Width="75" Height="25" BorderThickness="0"
                                            Content="{Binding Status}" Foreground="White"
                                            Background="{Binding BackColor}"/>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐