如何获取 dataGrid-Control 的 currentCell 的值? 我在 Windows CE 上使用 VS2008。
我有一个“CurrentCell”元素。 它的 .toString() 方法仅获取“windows.forms.datagrid”。 我如何获得值(value)? 这是一个 dataGrid,而不是 dataGridView!
一些代码:
DataGridCell dc = test_dataGrid.CurrentCell;
string cellValue = dc...
我在 dc 之后尝试使用 .toString,但得到的只是控件的名称。其他给定的属性是 'rowNumber'、'columnNumber'、'equals'、'getHashCode' 和 'getType'
请您参考如下方法:
试试这个:
DataGridCell dc = test_dataGrid.CurrentCell;
String cellValue = test_dataGrid[dc.RowNumber, dc.ColumnNumber].ToString();
基于此 MSDN 链接:
https://msdn.microsoft.com/en-us/library/aa287674(v=vs.71).aspx
