as add imagecolumn to the datagridview which contains the photo path.
the problem I have to click the button twice, then the picture comes. the code as follows.
I tried to place the loop to any where wthin the code area, but all dosen't works.
Anybody help.
the problem I have to click the button twice, then the picture comes. the code as follows.
Code:
Dim ds As DataSet
ds = AuctionComm.GetAuctions()
dgAuction.Columns.Clear()
dgAuction.Columns.Add(PhotoColumn)
dgAuction.DataSource = ds.Tables("Auctions")
RefreshRows(dgAuction)
With PhotoColumn
.ImageLayout = DataGridViewImageCellLayout.Zoom
.Name = "Details"
End With
Dim rowcount As Integer = datagridview1.Rows.Count()
For i As Integer = 0 To rowcount - 1
PhotoColumn.DataGridView.Rows(i).Cells("Details").Value = Image.FromFile(Application.StartupPath + datagridview1.Rows(i).Cells("Photo").Value.ToString())
Next
Anybody help.