How to remove null image in datagridview column image in vb.net?
Is there a way to remove null image in datagridview column image?
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then
item.Add(New item With {
.CodeProduct = TextBox1.Text
})
Grid.Bind(item)
TextBox1.Clear()
End If
End Sub
Public Class item
Public Property No() As Integer
Public Property CodeProduct() As String
Public Function GetAvatar() As DataGridViewAvatar
Return New DataGridViewAvatar() With {
.Value = CType(Me.CodeProduct, String),
.Icon = Image.FromFile("money.png")
}
End Function
Before use CustomImageCell
after use CustomImageCell