I've got a little problem i haven't being able to solve.
see screenhot here http://justanotherhomepage.net/3rowsselected.jpg

I use this sub to browse thru the selected rows of the datagrid
VB Code:
  1. Dim lista As New ArrayList
  2.         lista = GetSelectedRows(Me.DataGrid2)
  3.  
  4.         For i = 0 To lista.Count - 1
  5.  
  6.             ind = Convert.ToInt32(lista(i))
  7.             Me.DataGrid2.Select(ind)
  8.  
  9.             genc = Me.DataGrid2.Item(Me.DataGrid2.CurrentRowIndex, 0).ToString
  10.             gposenc = Convert.ToInt32(Me.DataGrid2.Item(Me.DataGrid2.CurrentRowIndex, 1))
  11.             Console.WriteLine("index=" & ind.ToString)
  12.             Console.WriteLine("enc=" & genc)
  13.             Console.WriteLine("posenc=" & gposenc.ToString)
  14.         Next
the console.write outoput is
index=34
enc=741/99
posenc=5
index=36
enc=741/99
posenc=5
index=38
enc=741/99
posenc=5

It should be
index=34
enc=741/99
posenc=1
index=36
enc=741/99
posenc=3
index=38
enc=741/99
posenc=5
VB Code:
  1. Private Function GetSelectedRows(ByVal dg As DataGrid) As System.Collections.ArrayList
  2.  
  3.         Dim al As New ArrayList
  4.         Dim cm As CurrencyManager = DirectCast(Me.BindingContext(dg.DataSource, dg.DataMember), CurrencyManager)
  5.         Dim dv As DataView = CType(cm.List, DataView)
  6.         Dim i As Integer
  7.  
  8.         For i = 0 To dv.Count - 1
  9.             If dg.IsSelected(i) Then
  10.  
  11.                 al.Add(i)
  12.  
  13.             End If
  14.  
  15.         Next
  16.  
  17.         Return al
  18.     End Function 'GetSelectedRows
Regards
Jorge