我在Windows窗体应用程序上有一个名为“ cbxActionType”的DataGridViewComboxColum,其项集合中具有以下值。 •供参考 •评论 •进行审查...等。 DataGridView1有一个名为“ NDays”的列,用于存储天数。如果将“ cbxActionType”选择的值更改为“信息”,如何将NDays列的值设置为0(零天)?
答案 0 :(得分:0)
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if (dataGridView1.CurrentRow.Cells["cbxActionType"].Value == "For Information")
{
dataGridView1.CurrentRow.Cells["NDays"].Value = 0;
}
}