You probably should not build a program that depends on the row index.
There is not an index property for the DataRow because a program does not
usually depend on an index that would change every time the collection is
resorted or re-filtered. If, for whatever reason, you have to get the row
index you might have to iterate through the rows collection till you find the
a row that equals the row you have selected, for example:
Dim foundRow As DataRow
' Create an array for the key values to find.
Dim findTheseVals(2) As Object
' Set the values of the keys to find
findTheseVals(0) = "John"
findTheseVals(1) = "Smith"
findTheseVals(2) = "5 Main St."
foundRow = myTable.Rows.Find(findTheseVals)
Dim i As Integer
Dim iRowIndex As Integer
For i = 0 To myTable.Rows.Count - 1
If myTable.Rows(i).Equals(foundRow) Then
iRowIndex = i
Exit For
End If
Next
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"TB" wrote:
> Hi All:
>
> Here´s a very simple question:
>
> I have created a datatable inside a dataset, and subsequently selected
> a particular row using certain criteria. How do get the index number of
> that particular row? There doesn´t seem to be property like
> "mydatable.currentlyselectedrowindex" or "myrow.indexnumber".
>
> Any suggestions will be highly appreciated.
>
> TB
>
>