I have an image cell where the image is added conditionally using CellFormatting:
Private Sub RadGridView1_CellFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles RadGridView1.CellFormatting
Try
If e.CellElement.ColumnIndex = 1 Then
If CType(e.CellElement.RowInfo.Cells("type").Value = 0, Decimal) Then
e.CellElement.Image = Me.ImageList1.Images(0)
ElseIf CType(e.CellElement.RowInfo.Cells("type").Value = 1, Decimal) Then
e.CellElement.Image = Me.ImageList1.Images(1)
ElseIf CType(e.CellElement.RowInfo.Cells("type").Value = 2, Decimal) Then
e.CellElement.Image = Me.ImageList1.Images(2)
ElseIf CType(e.CellElement.RowInfo.Cells("type").Value = 3, Decimal) Then
e.CellElement.Image = Me.ImageList1.Images(3)
Else
e.CellElement.Image = Me.ImageList1.Images(3)
End If
End If
e.CellElement.DrawFill = True
If Not IsDBNull(e.CellElement.RowInfo.Cells("Status").Value) Then
e.CellElement.DrawFill = True
Select Case (e.CellElement.RowInfo.Cells("Status").Value)
Case 23
e.CellElement.BackColor = Color.Pink
Case 24
e.CellElement.BackColor = Color.Chartreuse
Case 25
e.CellElement.BackColor = Color.Yellow
Case 26
e.CellElement.BackColor = Color.SkyBlue
Case 27
e.CellElement.BackColor = Color.LightCyan
Case 28
e.CellElement.BackColor = Color.Crimson
Case 29
e.CellElement.BackColor = Color.Blue
Case 30
e.CellElement.BackColor = Color.Red
Case Else
End Select
Else
e.CellElement.BackColor = Color.WhiteSmoke
End If
Catch ex As Exception
MsgBox(Err.Description)
End Try
End Sub
This colours the whole row I only want the background behind the image to have the colour applied how do I do this?
Regards
Joe