【发布时间】:2010-01-12 09:11:09
【问题描述】:
我已将 DataGridView 绑定到绑定源,其中数据源作为活动记录模型列表:
BindingSource bs = new BindingSource();
bs.DataSource = _user.Addresses;
Address 有名为 Actual 的 bool 属性,而我的 DataGridView 有 CheckBoxColumn:
DataGridViewCheckBoxColumn c = new DataGridViewCheckBoxColumn(false);
c.Name = "actualColumn";
c.HeaderText = "Aktualny";
c.DataPropertyName = "Actual";
c.AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;
addressesDataGridView.Columns.Add(c);
数据库中的数据显示正确。
当我单击选中的复选框单元格并取消选中它然后转到保存按钮时,我的绑定源中的属性 Actual 未被取消选中。
当我单击选中的复选框单元格并取消选中它并更改行选择然后单击保存时,按钮更改在 bindingsource 中可见。
此问题是否存在解决方法?
【问题讨论】:
标签: c# datagridview