I have created multiple datagridview at design time named dgv1 thru dgv50.
And the following records from a datatable dt
Column1 Column2
123 0
138 1
367 2
278 3
367 4
259 5
.... ..
145 9
Need to do a for loop to populate the dgv's with column1 data such that each dgv has three columns as
dgv1 has 1 2 3
dgv2 1 3 8
I started with this code, which I got from my previous post where I tried to populate multiple textboxes.
For i = 0 To dt.Rows.Count - 1
Dim name As String = "dgv" & (i + 1).ToString
Dim dgv = Me.Controls.Find(name, True)
If dgv.Length > 0 Then
..........................
end if
Hoping not to do an if..else or Select..Case, if I can help it.
Also, I would like to add one (is this even possible) oncellclick handler for all of the dgv's
Any help will be greatly appreciated.
And the following records from a datatable dt
Column1 Column2
123 0
138 1
367 2
278 3
367 4
259 5
.... ..
145 9
Need to do a for loop to populate the dgv's with column1 data such that each dgv has three columns as
dgv1 has 1 2 3
dgv2 1 3 8
I started with this code, which I got from my previous post where I tried to populate multiple textboxes.
For i = 0 To dt.Rows.Count - 1
Dim name As String = "dgv" & (i + 1).ToString
Dim dgv = Me.Controls.Find(name, True)
If dgv.Length > 0 Then
..........................
end if
Hoping not to do an if..else or Select..Case, if I can help it.
Also, I would like to add one (is this even possible) oncellclick handler for all of the dgv's
Any help will be greatly appreciated.