Runing code when form is loading does not work
Posted on 2006-11-15
I want to be able to put a link label onto a datagrid.
The following works on a loaded form:
Dim ColumnToChange As Integer = 2
Dim CurrentValue As String
For i As Integer = 0 To DataGridView1.Rows.Count - 1
CurrentValue = DataGridView1(ColumnToChange, i).Value
DataGridView1(ColumnToChange, i) = New DataGridViewLinkCell
DataGridView1(ColumnToChange, i).Value = CurrentValue
But when it is run on the on_load event or the activated event it runs through the code - but does not display the link label on the grid.
How can I get around this?
many thanks in advance