Pergunta

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.

Foi útil?

Solução

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();

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top