有人请告诉我如何获取windows mobile应用程序6.0中所选行gridview的第一列的值(模拟器是标准的)。我曾经使用下面显示的代码从Windows应用程序中获取此值,但这在Windows Mobile 6.0标准版本中不起作用
dgridShipmentItemTypes.Rows[nIndex].Cells["dgridShmtItmTypeName"].Value.ToString();
答案 0 :(得分:1)
试试这个:
int rowIndex = dgridShipmentItemTypes.CurrentCell.RowNumber;
int nIndex = 0; // Whatever your column index is.
object obj = dgridShipmentItemTypes[rowIndex, nIndex];
if ((obj != null) && (obj != DBNull.Value)) {
// do something with it
}