Hello Shannon,
Thanks for your post onMSDN forum.
I am not sure how you setup the tag ofDataGridViewcontrol, but if we bindTagto the list,it will show the currentrow ID value. See the following for example.
<CODE>
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Os As New List(Of Camper)()
Dim camp As Camper
For i As Integer = 0 To 10
camp = New Camper()
camp.Id = i.ToString()
camp.Name = "Item" & i
Os.Add(camp)
Next
Me.DataGridView1.DataSource = Os
Me.DataGridView1.DataBindings.Add("Tag", Os, "Id")
AddHandler Me.DataGridView1.CellDoubleClick, AddressOf dataGridView1_CellDoubleClick
End Sub
Private Sub dataGridView1_CellDoubleClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs)
MessageBox.Show(Me.DataGridView1.Tag.ToString())
End Sub
End Class
Public Class Camper
Private m_id As String
Public Property Id() As String
Get
Return m_id
End Get
Set(ByVal value As String)
m_id = value
End Set
End Property
Private m_name As String
Public Property Name() As String
Get
Return m_name
End Get
Set(ByVal value As String)
m_name = value
End Set
End Property
End Class
</CODE>
If you have any additional question, welcome to post here.
Thanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.