• Silverlight中Datagrid控件自定义列头样式Demo


    Demo如下:

    <sdk:DataGrid AutoGenerateColumns="False" Height="439" Background="LightGreen" HorizontalAlignment="Left" Margin="12,70,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="320" >
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTemplateColumn Width="100">
                        <sdk:DataGridTemplateColumn.HeaderStyle>
                            <Style TargetType="sdk:DataGridColumnHeader">
                                <Setter Property="ContentTemplate">
                                    <Setter.Value>
                                        <DataTemplate>
                                            <Grid>
                                                <CheckBox Content="全选"/>
                                            </Grid>
                                        </DataTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </sdk:DataGridTemplateColumn.HeaderStyle>
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding IsSelected,Mode=TwoWay}" Width="100" />
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                    <sdk:DataGridTextColumn CanUserReorder="True" Binding="{Binding Name,UpdateSourceTrigger=PropertyChanged}" CanUserResize="True" CanUserSort="True" Header="姓名" Width="*" />
                    <sdk:DataGridTextColumn CanUserReorder="True" Binding="{Binding Age,UpdateSourceTrigger=PropertyChanged}" CanUserResize="True" CanUserSort="True" Header="年龄" Width="*" />
                    <sdk:DataGridTextColumn CanUserReorder="True" Binding="{Binding Addr,UpdateSourceTrigger=PropertyChanged}" CanUserResize="True" CanUserSort="True" Header="住址" Width="*" />
                </sdk:DataGrid.Columns>
    </sdk:DataGrid>


  • 相关阅读:
    VMware下Linux配置网络
    前端知识之查漏补缺二
    前端网络基础查漏补缺篇
    简单实现Promise
    前端知识之查漏补缺-1
    git tag
    云服务器安装node环境 mysql nginx
    js动画
    vue原理之双向绑定虚
    js的封装、继承与多态
  • 原文地址:https://www.cnblogs.com/liancs/p/3879261.html
Copyright © 2020-2023  润新知