4

我正在构建一个移动应用程序,它允许操作员在现场管理他们的工作。我正在使用数据网格来显示用户作业列表。用户将能够通过选择 gridview 行并通过组合框为其分配状态来接受或拒绝工作。

为此,我需要为数据网格的选定行获取单元格 9 (JobID) 的值。因为我使用的是 .NET Compact 框架,所以我无法访问某些属性,例如 SelectedRow。我整个上午都在网上搜寻指针,但我发现的大多数示例都是针对 .NET 框架,而不是 .NET Compact Framework。这对我一点帮助都没有,因为所有示例似乎都引用了 System.Web.UI,我被认为不适用于 .NET CF

谁能给我任何建议以实现智能设备应用程序。所有帮助将不胜感激。

提前致谢。

4

2 回答 2

6

我将使用CurrentCell数据网格上的属性来确定具有焦点的行,然后从该行中选择所需的值。

int row = dgJobList.CurrentCell.RowNumber;
int column = 9;
string cellValue = dgJobList[row,column].toString();
于 2012-12-21T10:37:43.697 回答
0

thank you @mattias. As a VB .net user I will give my own code to do the same thing.

dim rom as integer

dim column as integer

dim cellvalue as string

row = dgJobList.CurrentCell.RowNumber

column = 9

cellValue = dgJobList(row,column).toString()

You can use ctype() to get the content of the cell with a specific type.

于 2013-09-09T15:07:40.850 回答