Re: Passing current record
I think that I developed something what you can use.
Take this code on this adress.
https://www.planetsourcecode.com/vb/...7492&lngWId=10
Re: Passing current record
write a Public Sub New(ByRef dgvi As DataGridViewItem) on your second form with a DataGridViewItem(?) object to pass.
Then, just pass the selected datagridviewitem from the datagridview, and then extract the appropriate information from the appropriate columns/field/index.
Then when you want to launch the form, do:
Dim frm as New Form(DataGridView.SelectedItems(0))
I may be totally wrong, but I think if you pass it byref it will update the datagridview as well.
I may be wrong on that tho.
Re: Passing current record
Follow the CodeBank link in my signature and check out my thread entitled Update Grid Row in Dialogue
Re: Passing current record
Quote:
Originally Posted by
Seraph
I may be totally wrong, but I think if you pass it byref it will update the datagridview as well.
I may be wrong on that tho.
That would only be true if the type of the parameter was a value type. In this case it's a reference type, so you would only need to pass by reference if you intended to assign a new object to the parameter within the method.
Re: Passing current record
Quote:
Originally Posted by
jmcilhinney
Follow the CodeBank link in my signature and check out my thread entitled Update Grid Row in Dialogue
Just the ticket, many thanks for the suggestions.
Regards
Luke