在datagridview中,是否有非列行的click事件?
我指的是,在这个事件中,如果点及列名的那行,事件不会被触发。

解决方案 »

  1.   

    有click事件。 Attributes.Add
      

  2.   

    CellContentClick  只针对行里面有值,它才执行.
    CellClick  对正个DG里面的所有区域都执行.
      

  3.   

    鼠标单击事件判断 RowIndex 值
      

  4.   

    DataGridView 的CellMouseClic 事件 private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
            {            if (e.RowIndex>0)
                {
                    MessageBox.Show("Test");
                    
                }
            }