1.
根据条件来判断某一个单元格的值是否为可编辑,关键是datagridview中的CellBeginEdit
winform datagridview  根据条件来判断某一个单元格的值是否为可编辑

 

 1   private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
 2         {
 3             var dgv = (DataGridView)sender;
 4             string name ="wtq";
 5             string cellText = Convert.ToString(dgv[0,e.RowIndex].Value) ;
 6             if (cellText.Equals(name))
 7             {
 8                 e.Cancel = true;
 9             }
10           
11         }

相关文章:

  • 2022-12-23
  • 2021-09-27
  • 2021-09-22
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2021-12-20
  • 2022-12-23
  • 2021-09-29
相关资源
相似解决方案