private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            DataGridView dgv = (DataGridView)sender;
            if (e.RowIndex < dgv.Rows.Count - 1)//这个判断,如果DataGridView没有设置为添加.就可以不要了          
            {

                if (e.ColumnIndex == 4)
                {
                    e.Value = ps.订单的评价状态(e.Value.ToString());
                    //e.CellStyle.ForeColor = Color.Green;
                }
                else if (e.ColumnIndex == 15)
                {
                    e.Value = ps.运送类型(e.Value.ToString());
                    //e.CellStyle.ForeColor = Color.Green;
                }

                //else if (e.ColumnIndex == 19)
                //{
                //    e.Value = ps.运送类型(e.Value.ToString());
                //    //e.CellStyle.ForeColor = Color.Green;
                //}
            }
        }

相关文章:

  • 2021-05-07
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-23
  • 2021-07-19
  • 2022-01-20
  • 2021-07-17
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案