如何让DataGrid每次单击时选中一行记录而不是进入到某一个单元格,急。。。在线等,解决给分! 忘了说了,自然是winform,webform没有这个问题。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void dataGrid1_Click(object sender, EventArgs e){ dataGrid1.Select(dataGrid1.CurrentRowIndex);}你试试,偶没测试!! 捕捉单击事件,用select(n)即可 我试了,好象不行,选中的还是单个cell. to uscool(小小风) :可否给个提示 private void dataGrid1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { System.Windows.Forms.DataGrid.HitTestInfo info = this.dataGrid1.HitTest(e.X, e.Y); if(info.Row>=0) { this.dataGrid1.UnSelect(this.dataGrid1.CurrentRowIndex); this.dataGrid1.CurrentRowIndex=info.Row; this.dataGrid1.Select(info.Row); } } C# 关于opendatasource动态调用 关于遍历listview控件中的mp3文件 跪求:中英版网站web.config问题~~ c#构造函数的问题 CSDN 论坛首页网页源代码如何下载? 请求下载文件 用反射获取字段的长度? vs.net 2005 beta 2 没有了智能提示 C#法开发的数据库程序怎样打包才到其它的电脑上运行 如何根据文件的扩展名。找到文件关联在一起的程序的文件名? 请教下用OleDb怎么访问Sql 2000数据库表的primary key? 我现在的水平能找工作了么?(请各位前辈赐教,散分)
{
dataGrid1.Select(dataGrid1.CurrentRowIndex);
}
你试试,偶没测试!!
可否给个提示
{
System.Windows.Forms.DataGrid.HitTestInfo info = this.dataGrid1.HitTest(e.X, e.Y);
if(info.Row>=0)
{
this.dataGrid1.UnSelect(this.dataGrid1.CurrentRowIndex);
this.dataGrid1.CurrentRowIndex=info.Row;
this.dataGrid1.Select(info.Row);
}
}