Imports System.Data

Public Class GridAdapter
  Private dtable As DataTable
  Private Dgrid As DataGrid
  '-----   
  Public Sub New(ByVal grid As DataGrid)
    dtable = CType(grid.DataSource, DataTable)
    Dgrid = grid
  End Sub
  '-----      
  Public Sub addText(ByVal sw As Swimmer)
    Dim scnt As String
    Dim row As DataRow

    row = dtable.NewRow
    row("Frname") = sw.getFirstName
    row(1) = sw.getLastName
    row(2) = sw.getAge              'Dana typu Integer
    dtable.Rows.Add(row)
    dtable.AcceptChanges()
  End Sub

End Class
