【发布时间】:2015-06-17 09:00:18
【问题描述】:
我的期望:Is Wash 和 Is Return 是 ComboBox 列;当我点击Is Wash时,我打算将Is Return更改为true。
这是我的DataGridView:
我尝试使用CellContentClick 和CellClick
下面是我的功能:
private void dtGridViewLoan_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1)
return;
if (dtGridViewLoan.SelectedRows[0].Cells["is_wash"].Value != DBNull.Value)
if (Convert.ToBoolean(dtGridViewLoan.Rows[e.RowIndex].Cells["is_wash"].Value))
{
dtGridViewLoan.Rows[e.RowIndex].Cells["is_return"].Value = true;
}
}
最后,无论我如何更改ComboBox 的值,数据本身都会不断返回false,即使它是true。请帮忙。
【问题讨论】:
-
问题不清楚请详细说明您想要什么
-
TaW 的另一个回答 option(这已经很有效了)。
标签: c# datagridview