I use Visual studio 8.0
My question is, if a row is clicked in datagridview I want that image appears in the headercell of the row
If I use following code goes well:
DataGridView1.Rows(i).HeaderCell.Value = "selected"
Then the text "selected" appear in the headercell of the row that is selected.
Now I want instead of a text that an image appears.
I've tried the following code, but that does not work!
DataGridView1.Rows(i).HeaderCell.Value = System.Drawing.Image.FromFile("c:\image\oke.png")
If anyone knows the answer, please respond !
thanks,
André
Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
Dim i As Integer
i = DataGridView1.CurrentRow.Index
DataGridView1.Rows(i).Selected = True
DataGridView1.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders)
DataGridView1.Rows(i).HeaderCell.Value = System.Drawing.Image.FromFile("c:\image\oke.png")
End Sub