标签:GridView use win ons ntc inf selected windows select
1、设置DataGridView 的属性 SelectionMode
SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
private void dgvResult_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex == -1 || e.ColumnIndex == -1) return; if (e.Button == System.Windows.Forms.MouseButtons.Right) { this.dgvResult.ClearSelection(); this.dgvResult.CurrentRow.Selected = false; this.dgvResult.Rows[e.RowIndex].Selected = true; this.dgvResult.CurrentCell = dgvResult.Rows[e.RowIndex].Cells[e.ColumnIndex]; } }
标签:GridView use win ons ntc inf selected windows select
原文地址:http://www.cnblogs.com/xakml/p/7053745.html