1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Dim id_format As String = DataSchema.DocumentSchema.id_format.ToString
Dim fileName As String = DataSchema.DocumentSchema.documentFileName.ToString
Dim personName As String = DataSchema.PersonSchema.name.ToString
Dim linkDate As String = DataSchema.Customer_DocumentSchema.linkDate.ToString
Dim columnType As New DataGridViewImageColumn
With columnType
.HeaderText = "lblType"
.Name = "imageType"
End With
Me.dgvListDocuments.Columns.Insert(0, columnType)
Me.dgvListDocuments.Columns(fileName).Visible = True
Me.dgvListDocuments.Columns(fileName).HeaderText = "lblFileName"
Me.dgvListDocuments.Columns(linkDate).Visible = True
Me.dgvListDocuments.Columns(linkDate).HeaderText = "lblLinkDate"
Me.dgvListDocuments.Columns(personName).Visible = True
Me.dgvListDocuments.Columns(personName).HeaderText = "lblCreateBy"
For Each rows As DataGridViewRow In dgvListDocuments.Rows
For Each formatImage In Documents.GetMyFormatDocuments
'Je parcours le fichier pour trouver l'image correspondante
If formatImage.id_format = rows.Cells(id_format).Value Then
Dim myNameImage As String = formatImage.typeFormat
dgvListDocuments.Item(0, rows.Index).Value = Nothing
dgvListDocuments.Item(0, rows.Index).Value = New Bitmap(PathsConfigurator.GraphicsPath & myNameImage & ".ico")
'System.Threading.Thread.Sleep(300)
'dgvListDocuments.UpdateCellValue(0, rows.Index)
'dgvListDocuments.Update()
'dgvListDocuments.Refresh()
Exit For
End If
Next
Next |
Partager