Datagridview绘制

#region 绘制
        private void dataGridView_main_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
        {
            int status_column_index = 14;//会诊状态所在列
            DataGridViewRow row = dataGridView_main.Rows[e.RowIndex];//获取行
            DataGridViewCell cell = row.Cells[15];//按钮所在单元格
            string status = (row.Cells[status_column_index]).Value.ToString();//每行中的状态所在列
            if (status == "1" && cell.GetType() == typeof(DataGridViewButtonCell) && cell.Style.NullValue.ToString() != "报告")//当每行中的状态列不为4时就把此行中的审核按钮替换为文本单元格
            {
                cell.Style.NullValue = "分诊";
            }
            if (status == "3" && cell.GetType() == typeof(DataGridViewButtonCell) && cell.Style.NullValue.ToString() != "审核")//当每行中的状态列不为4时就把此行中的审核按钮替换为文本单元格
            {
                cell.Style.NullValue = "重新分诊";
            }
        }
        #endregion

 

转载于:https://www.cnblogs.com/wmm-pcy/p/9752850.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值