关于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));
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-12-04
  • 2021-07-12
  • 2022-12-23
相关资源
相似解决方案