c#中DataGridView 如何设置 才能选中一行 设置鼠标事件

        private void dataGridViewQQGloup_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            dataGridViewQQGloup.Rows[dataGridViewQQGloup.CurrentCell.RowIndex].Selected = true;
        }

        private void dataGridViewQQGloup_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
        {
            dataGridViewQQGloup.Rows[dataGridViewQQGloup.CurrentCell.RowIndex].Selected = true;
        }

        private void dataGridViewQQGloup_CellMouseMove(object sender, DataGridViewCellMouseEventArgs e)
        {
            dataGridViewQQGloup.Rows[dataGridViewQQGloup.CurrentCell.RowIndex].Selected = true;
        }

 

你可能感兴趣的:(datagridview)