其他分享
首页 > 其他分享> > WPF DataGrid自定义复选框

WPF DataGrid自定义复选框

作者:互联网

<DataGridTemplateColumn Header="选择" Width="Auto"  >        <DataGridTemplateColumn.HeaderTemplate>        <DataTemplate>            <StackPanel Orientation="Horizontal">                <TextBlock Text="选择" FontSize="15">TextBlock>                <CheckBox x:Name="DepPatientCheckBox" Margin="10,0,0,0" Click="SelectAllPatientInDep">CheckBox>            StackPanel>        DataTemplate>    DataGridTemplateColumn.HeaderTemplate>        <DataGridTemplateColumn.CellTemplate>        <DataTemplate>            <CheckBox Name="ckbItem" IsChecked="{Binding IsCheckBinding,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Click="CkbItem_OnClick"  HorizontalAlignment="Center">CheckBox>        DataTemplate>    DataGridTemplateColumn.CellTemplate>DataGridTemplateColumn>

标签:CheckBox,自定义,DataGridTemplateColumn,HeaderTemplate,StackPanel,DataGrid,DataTempl
来源: https://blog.51cto.com/u_15180952/2732433