DGV设置单元格背景颜色(inf二次开发)

 foreach (var dr in dgvOdExec.Grid.Rows)
            {
                if (dr.Cells[nameof(MedicalSkillsVo.OdTypCode)].Text == ExtraCharacterStrDefine.TREAT)
                {
                    dr.Cells[nameof(MedicalSkillsVo.ExecCnt)].Appearance.BackColor = Color.FromArgb(0, 255, 255);
                    dr.Activation = Activation.AllowEdit;
                }
                else
                {
                    dr.Activation = Activation.NoEdit;
                }
            }

 

posted @ 2021-03-23 18:08  博客YS  阅读(49)  评论(0编辑  收藏  举报