Winform DataGridView中行灰显问题 本帖最后由 z_zhi 于 2013-04-11 10:21:02 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { e.CellStyle.BackColor =XXXX } 你可以先设定第n行为只读,再设定其前、背景色 DataGridViewRow row = this.dataGridView1.Rows[n]; row.ReadOnly = true; row.DefaultCellStyle.BackColor = Color.Red; row.DefaultCellStyle.ForeColor = Color.Red; 我现在的界面是这样的:就是整个行都灰显、第一列的checkbox也不能勾选 你可能需要重绘这行中所有cell的颜色,同时处理一些鼠标键盘选择这个cell的事件,使其不可选中。Google: gray out datagridview C# C#问题 请教高手~~~ FORM.SHOW();和FORM_LOAD()问题 CompareTo对象参数的变化 一个关于结构体嵌套的问题? 上传图片到数据库里方法? 怎么得到返回值 tts 发音问题 TreeView的节点动态生成的疑问??? 我是菜鸟!什么都不懂! 大神们过来帮一下这个简单的问题 pictureBox绘图如何处理大小超出窗体大小问题?
void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
e.CellStyle.BackColor =XXXX
}
row.ReadOnly = true;
row.DefaultCellStyle.BackColor = Color.Red;
row.DefaultCellStyle.ForeColor = Color.Red;