C
Co
Hi All,
I have a DataGridView with two colums. One checkboxcolumn and one
imagecolumn.
I want the imagecolumn to display an image when I click the
checkboxcolumn and make it's value TRUE.
I don't know what event to use. The code I have doesn't work.
Private Sub setDGVImageStatus(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellValueEventArgs)
Dim colName As String = DirectCast(sender,
DataGridView).Columns(e.ColumnIndex).Name.ToString
If DirectCast(sender, DataGridView).Rows(e.RowIndex).Cells
("Status").Value.Equals(True) Then
e.Value = ImageList1.Images(0)
End If
End Sub
Private Sub DataGridView1_CellValueNeeded(ByVal sender As Object,
ByVal e As System.Windows.Forms.DataGridViewCellValueEventArgs)
Handles DataGridView1.CellValueNeeded
If e.ColumnIndex = 6 Then setDGVImageStatus(sender, e)
End Sub
Regards
Marco
I have a DataGridView with two colums. One checkboxcolumn and one
imagecolumn.
I want the imagecolumn to display an image when I click the
checkboxcolumn and make it's value TRUE.
I don't know what event to use. The code I have doesn't work.
Private Sub setDGVImageStatus(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellValueEventArgs)
Dim colName As String = DirectCast(sender,
DataGridView).Columns(e.ColumnIndex).Name.ToString
If DirectCast(sender, DataGridView).Rows(e.RowIndex).Cells
("Status").Value.Equals(True) Then
e.Value = ImageList1.Images(0)
End If
End Sub
Private Sub DataGridView1_CellValueNeeded(ByVal sender As Object,
ByVal e As System.Windows.Forms.DataGridViewCellValueEventArgs)
Handles DataGridView1.CellValueNeeded
If e.ColumnIndex = 6 Then setDGVImageStatus(sender, e)
End Sub
Regards
Marco