怎么设置当前行datagridview 比如我想把datagirdview的第三行设成当前行怎么写代码?不要发送键盘按键的. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 // 设置选择某一个cell 时 显示选择整行。dataGridView_mydg.SelectionMode = DataGridViewSelectionMode.FullRowSelect;// 设置第三行为当前行。dataGridView_mydg.CurrentCell = dataGridView_mydg.Rows[2].Cells[0]; 也可以这样!this.dataGridView1.CurrentCell = this.dataGridView1.Rows[2].Cells[0];this.dataGridView1.Rows[2].Selected=true; 学习datagridviewdataGridView1_mydg.SelectionMode = DataGridViewSelectionMode.FullRowSelect;this.dataGridView1.Rows[2].Selected=true; private void drugListDataGridView_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Right) { System.Console.WriteLine(e.RowIndex); int curRow = e.RowIndex; if (curRow < 0 || curRow > this.drugListDataGridView.Rows.Count) { curRow = 0; } this.drugListDataGridView.CurrentCell.Selected=false; this.drugListDataGridView.CurrentCell = this.drugListDataGridView[0, curRow]; this.drugListDataGridView.ContextMenuStrip=this.contextMenuStrip1; } } dataGridView1.Rows[1].Selected = true; this.drugListDataGridView.CurrentCell = this.drugListDataGridView[0, curRow]; 1楼的没错//设置第3行为当前行dataGridView1.CurrentCell = datagirdview.Rows[3].Cells[0];问题是你是否要获取当前行,到底是怎样无法实现 对软考系统架构师教程的感想 急,急,急分页问题??? 怎么判断客户端是否安装 。NET框架,和AcitveX控件 c#怎样导出到word vs2005的WebService问题 System.Runtime.InteropServices.SEHException异常,,,,郁闷死~~~ c语言实训 如何解决客户端webservice传递参数长度限制? 安装错误 求百分号的正则表达式! 求一个起线程的模板例子,可以传参的!! 现在做vb,asp,想转为.net, 但是是新手,谁肯请我?
dataGridView_mydg.SelectionMode = DataGridViewSelectionMode.FullRowSelect;// 设置第三行为当前行。
dataGridView_mydg.CurrentCell = dataGridView_mydg.Rows[2].Cells[0];
this.dataGridView1.CurrentCell = this.dataGridView1.Rows[2].Cells[0];
this.dataGridView1.Rows[2].Selected=true;
dataGridView1_mydg.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.Rows[2].Selected=true;
{
if (e.Button == MouseButtons.Right)
{
System.Console.WriteLine(e.RowIndex);
int curRow = e.RowIndex;
if (curRow < 0 || curRow > this.drugListDataGridView.Rows.Count)
{
curRow = 0;
}
this.drugListDataGridView.CurrentCell.Selected=false;
this.drugListDataGridView.CurrentCell = this.drugListDataGridView[0, curRow];
this.drugListDataGridView.ContextMenuStrip=this.contextMenuStrip1;
}
}
dataGridView1.CurrentCell = datagirdview.Rows[3].Cells[0];问题是你是否要获取当前行,到底是怎样无法实现