dataGridView单击事件回顾

    xiaoxiao2021-03-25  91

    private  void  dataGridView1_CellContentClick( object  sender, DataGridViewCellEventArgs e) {       this .dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString(); //第一种取法       this .dataGridView1.Rows[e.RowIndex].Cells[ "你所要取值的列名称" ].Value.ToString(); //第二种取法       this .dataGridView1.CurrentRow.Cells[ "你所要取值的列名称" ].Value.ToString(); //第三种取法 }   private  void  dataGridView1_CellClick( object  sender, DataGridViewCellEventArgs e) {       this .dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString(); //第一种取法       this .dataGridView1.Rows[e.RowIndex].Cells[ "你所要取值的列名称" ].Value.ToString(); //第二种取法       this .dataGridView1.CurrentRow.Cells[ "你所要取值的列名称" ].Value.ToString(); //第三种取法 }   private  void  dataGridView1_CellDoubleClick( object  sender, DataGridViewCellEventArgs e) {       this .dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString(); //第一种取法       this .dataGridView1.Rows[e.RowIndex].Cells[ "你所要取值的列名称" ].Value.ToString(); //第二种取法       this .dataGridView1.CurrentRow.Cells[ "你所要取值的列名称" ].Value.ToString(); //第三种取法 }
    转载请注明原文地址: https://ju.6miu.com/read-16782.html

    最新回复(0)