C# – Retrieving data from a datagrid using compact framework 3.5

ccompact-frameworkdatagridsmart-device

I am building a mobile application which allows operators to manage their jobs in the field. I am using a datagrid to display the users Job list. The user will be able to accept or decline jobs by selecting the gridview row and assigning a status to it via a combo box.

To do this I need to get the value of cell 9 (JobID) for the selected row of the datagrid. Because I am using .NET Compact framework I'm unable to access certain properties such as SelectedRow. I've spent all morning trawling the web for pointers but most examples I find are targeted at .NET framework, rather than .NET Compact Framework. This is no help to me at all because all examples seem to reference System.Web.UI which I am led to believe isn't available for .NET CF

Can anyone offer me any suggestions to achieve this for smart device applications. All help will be greatly appreciated.

Thanks in advance.

Best Answer

I would use the CurrentCell propery on the datagrid to determin what row that has focus and then select out the wanted value from that row.

int row = dgJobList.CurrentCell.RowNumber;
int column = 9;
string cellValue = dgJobList[row,column].toString();
Related Topic