How to get the selected row in DataGrid in a smartphone application?

I am working on a smartphone application where I have a DataGrid in winform.

I want to get the cell value of the selected row.

+3
source share
2 answers

This will return the value of the selected DataGrid cell in the smartphone application.

   MessageBox.Show(dgDataGrid[dgDataGrid.CurrentCell.RowNumber,
 dgDataGrid.CurrentCell.ColumnNumber].ToString());

With this, you can get or set the value of the cell.

+7
source

Due to lack of information, one is hacked here if our methods are from the old VB.net compact framework project.

For i As Integer = 1 To DataGrid.VisibleRowCount - 1

  If DataGrid.IsSelected(i) Then

    MessageBox.Show(DataGrid.Item(i, 0).ToString())

  End If

Next

This will show a message box with the contents of the first cell of each selected row.

+4
source

Source: https://habr.com/ru/post/1758682/


All Articles