怎么获取dataGridView1控件中列所在的行,然后再让行变色啊

解决方案 »

  1.   

    不太明白你要表达什么意思?
    是否通过移动鼠标使鼠标所在行位置变色啊?onmouseover和onmouseout应该可以达到这样的效果,试试
      

  2.   

       this.dataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.Red;
      

  3.   

    背景色:this.dataGridView1.Rows[行索引].DefaultCellStyle.BackColor = Color.Red;
    前景色:this.dataGridView1.Rows[行索引].DefaultCellStyle.ForeColor = Color.Red;