Umwandlung eines
DataGridViewRow-Objekts in ein Objekt-Typ
Beispiel:
Dim P As Personen = ToDataObject(Of Personen )(Me.DataGridView1.Rows(e.RowIndex))
Public Shared Function ToDataObject(Of T)(ByVal Value As DataGridViewRow) As T
Try
Return CType(Value.DataBoundItem, T)
Catch ex As Exception
Return Nothing
End Try
End Function
Kommentare zum Snippet