我的Windows窗体应用程序上有一个名为“cbxActionType”的DataGridViewComboxColum,它的项集合中包含以下值。 •有关信息•用于注释•用于查看...等.DataGridView1有一个名为“NDays”的列,用于存储天数。如果将“cbxActionType”选择的值更改为“For Information”,如何将NDays列值设置为0(零天)?
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if (dataGridView1.CurrentRow.Cells["cbxActionType"].Value == "For Information")
{
dataGridView1.CurrentRow.Cells["NDays"].Value = 0;
}
}