How to change the row name with option button?
If option button export selected:
Private sub optexport_click()
txtimport = "I"
fgcargo.textmatrix(0,2) = "bl number"
fgcargo.textmatrix(0,4) = "date"
end sub
If option button import selected:
Private sub optimport_click()
txtimport = "E"
fgcargo.textmatrix(0,2) = "so number"
fgcargo.textmatrix(0,4) = "date"
end sub
The GridView will take it’s column names from the data source.
This means that if you have a column named “bl_number” in the database, the column in the GridView will name the column “bl_number”.
You could try something like the following:
Where
Cells(ByVal index As Integer)is the index of the column in the GridView (0 based).Hope this helps.
NOTE: This will not work with a Windows Forms DataGridView control.
For a Windows Forms DataGridView, go into it’s columns collection. You can change the header text for each column there.
In code, you could try the following:
Good luck!