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>
上一篇:给DataGrid单元行添加双击事件


下一篇:C#中为DataGrid添加下拉列表框(转载)