您的位置:首页 > 其它

设置datagridview的某个checkbox不显示

2010-05-13 10:46 302 查看
public void chang_color(int i, string str)
{
dataGridView1.Rows[i].Cells[str].ReadOnly = true;
DataGridViewCell cell = new DataGridViewTextBoxCell();
cell.Style.BackColor = Color.Wheat;
//cell.ReadOnly = true;
cell.Value = "N";
cell.Style.BackColor = Color.White;
dataGridView1.Rows[i].Cells[str] = cell;
dataGridView1.Rows[i].Cells[str].Style.ForeColor = Color.White;
dataGridView1.Rows[i].Cells[str].Style.SelectionBackColor = Color.White;
dataGridView1.Rows[i].Cells[str].Style.SelectionForeColor = Color.White;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: