如何确定datagrid中的选中行? datagrid.IsSelected(i) == true 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样不行的 currentRowIndex也不好使,因为排序后 datagrid的currentIndex跟绑定到datagrid.datasoruce的dataset的当前列的序号是不一样的,而我用datagrid.datasource.row[当前序号][列名]来读数据 有其他的法子吗? this.dataGrid1.CurrentCell.RowNumber这就是你当前所选的行号 DataGrid myGrid = (DataGrid) sender; System.Windows.Forms.DataGrid.HitTestInfo hti; hti = myGrid.HitTest(e.X, e.Y); if(hti.Type == System.Windows.Forms.DataGrid.HitTestType.Cell ||hti.Type==System.Windows.Forms.DataGrid.HitTestType.RowHeader)myGrid.CurrentCell = new DataGridCell(hti.Row,0);//弹出你的菜单} WinForm 中窗口最小化的捕获 对数组CopyTo方法的困惑 求助:winform中dataGridView的列头问题 C#的Bug? 生成Excel文件时,提示拒绝访问?请教各位大哥了!!!! application.run 产生的argumentException 关于P2P的问题,大家请进来! 用StreamReader的ReadToEnd方法读取时,提示"不能为非负数字",怎样在读取前检测是否是负数呢??? comboBox 怎么样加入图片啊 如何写一个Loading模块? c#的程序为何不能加壳? 初来乍到,交个朋友吧。。。
System.Windows.Forms.DataGrid.HitTestInfo hti;
hti = myGrid.HitTest(e.X, e.Y);
if(hti.Type == System.Windows.Forms.DataGrid.HitTestType.Cell ||hti.Type==System.Windows.Forms.DataGrid.HitTestType.RowHeader)
myGrid.CurrentCell = new DataGridCell(hti.Row,0);
//弹出你的菜单
}