DataGrid for win form DataRowView drv = (DataRowView)this.BindingContext[DataSet,TableName].Current;sting s = drv["Columns"].ToString(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 dataGrid[dataGrid.CurrentCell],获取当前所选中单元格的值,返回的是object 看看这个http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q788q http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q934q private void dataGrid1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { System.Drawing.Point pt = new Point(e.X, e.Y); DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt); if(hti.Type == DataGrid.HitTestType.Cell) { dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column); dataGrid1.Select(hti.Row); } } 楼上的就行了。你可以参看一下这一个贴子:http://expert.csdn.net/Expert/topic/1577/1577810.xml?temp=.1517298 menuStrip如何设置点击后的背景色 C#通过串口读取数据(时间间隔为3秒),使用gdi+绘制实时曲线 CLR Stored Procedure 关于标点符号不换行的问题 c#怎么会内存泄露?????? 请教?怎么用C#查找ACCESS数据库中的一段时间的数据 判断时期的有效性函数是什么.怎么写 怎么把无数个点(PointF)加入到点数组(PointF[])中? 如何在.NET中注册服务型组件(即COM+) 我的最后的可用分了:谁知道用C#或C++。NET实现后期绑定的方法???? 請教一個關于插入圖片的問題 如何操作Foxpro的DBF数据表文件??
获取当前所选中单元格的值,
返回的是object
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q788q
{
System.Drawing.Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
if(hti.Type == DataGrid.HitTestType.Cell)
{
dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
dataGrid1.Select(hti.Row);
}
}
你可以参看一下这一个贴子:
http://expert.csdn.net/Expert/topic/1577/1577810.xml?temp=.1517298