RIAS
asked on
Find Rowindex of Datarow
Hello,
I am trying to find rowindex of datarow( vb.net desktop). The code is as follows:
Cheers
I am trying to find rowindex of datarow( vb.net desktop). The code is as follows:
Dim dtDgDiarySource As New DataTable
dtDgtestSource = FrmMain.Dgtest.DataSource
Dim rows As DataRow()
rows = dtDgtestSource.Select("D_UID = '" & row.Item("D_UID").ToString() & "'")
Cheers
Do you mean which row is that you pull out from in the DataSource collection?
ASKER
Yes, Andy :> Need the row index
ASKER
Been struggling with this for quite sometime
I'd suggest a Foreach loop with a counter. Break out of the loop when you find the row you want - the counter would then be the index of that row.
ASKER
Yes Andy thanks for that but was trying to find some clever way ..
Or does this work?
dim rowindex as long = dtDgtestSource .Rows.IndexOf(rows)
dim rowindex as long = dtDgtestSource .Rows.IndexOf(rows)
ASKER
Thanks will try and brb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
ASKER
Perfect!!!!!Thanks mate as always!