Abdul Adhar
Abdul Adhar

Reputation: 75

Get Value of a colum from GridView Windows Mobile 6.0

Somebody please tell me how to get the value of the first column of the selected row of gridview in windows mobile application 6.0 (Emulator is standard). I used to get this value from the windows application by using the code shown below but this is not working in windows mobile 6.0 standard verstion

dgridShipmentItemTypes.Rows[nIndex].Cells["dgridShmtItmTypeName"].Value.ToString();

Upvotes: 0

Views: 779

Answers (1)

user153923
user153923

Reputation:

Try this:

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
}

Upvotes: 1

Related Questions