zoukankan      html  css  js  c++  java
  • WPF dataGrid中的check的改变事件

    关于datagrid信息:

    <DataGridTemplateColumn Header="备注">
    <DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
    <StackPanel Orientation="Horizontal">
    <CheckBox IsChecked="{Binding IsChecked,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Click="CheckBox_Click"></CheckBox>
    <TextBlock Text="{Binding strNo}"></TextBlock>
    </StackPanel>
    </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
    </DataGridTemplateColumn>

    类的改变事件:

    public bool Checked2;
    public bool IsChecked
    {
    set
    {
    Checked2 = value;
    OnPropertyChanged("IsChecked");
    }
    get
    {
    return Checked2;
    }
    }
    public event PropertyChangedEventHandler PropertyChanged;

    protected void OnPropertyChanged(string propertyName)
    {
    if (PropertyChanged != null)
    {
    PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
    }

  • 相关阅读:
    每日总结2.26
    《梦断代码》阅读笔记三
    每日总结2.25
    每日总结2.24
    每日总结2.23
    每日总结2.22
    每日总结2.19
    《梦断代码》阅读笔记二
    Java-11 形参和实参
    Java-10 final用法
  • 原文地址:https://www.cnblogs.com/wlming/p/5084799.html
Copyright © 2011-2022 走看看