[RESOLVED] Calling a value from a Grid to a variable in another form
I have datagrid in which the 0th column has ID. What i want is while clicking on the datagrid the id of the particular row has to be load in the variable in the second form. For this i have created a public variable in the second form
Code:
Public editID As Long
and in the first form i wrote
Code:
Private Sub grdDrugs_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdDrugs.DoubleClick
frmDrug.Show()
frmDrug.editID = CInt(grdDrugs.Item(0,grdDrugs.CurrentCell.RowIndex).Value())
End Sub
but here its not returning any value to EditID while loading the second form
is there any way to do this
Thanks
Sajna
Re: Calling a value from a Grid to a variable in another form
yes it is solved
i wrote
Code:
Private editID As Long
Public Property [PassedValue]() As Long
Get
Return editID
End Get
Set(ByVal Value As Long)
editID = Value
End Set
End Property
in form 2
and
wrote
Code:
Dim Obj As New frmDrug
Obj.PassedValue = CInt(grdDrugs.Item(0, grdDrugs.CurrentCell.RowIndex).Value())
Obj.Show()
in form1