private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
   
if (e.ColumnIndex == 1 /*status列的Index*/)
    {
       
if (object.Equals(e.Value, 0))
        {
            e.Value
= "未完成";
            e.CellStyle.ForeColor
= Color.Red;
        }
       
else
        {
            e.Value
= "已完成";
            e.CellStyle.ForeColor
= Color.Green;
        }
    }
}

相关文章:

  • 2021-07-24
  • 2022-12-23
  • 2021-06-03
  • 2021-11-07
  • 2022-01-23
  • 2021-06-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2022-02-26
  • 2022-12-23
  • 2021-09-08
相关资源
相似解决方案