Hi,
I've looked at a few examples of this but they don't appear to work. I'm getting an error when actually assigning the image. The error is Exception has been thrown by the target of an invocation.
The code that I'm trying is:
The line where it seems to fail is element.image = imagelist.images(0). The imagelist is an image list surprisingly enough and it has images in it. They are being used elsewhere to populate an image column in the grid view.
Is there anything obvious stands out?
Thanks
I've looked at a few examples of this but they don't appear to work. I'm getting an error when actually assigning the image. The error is Exception has been thrown by the target of an invocation.
The code that I'm trying is:
Private
Sub
rgvItems_CellFormatting(
ByVal
sender
As
Object
,
ByVal
e
As
CellFormattingEventArgs)
Handles
rgvItems.CellFormatting
If
TypeOf
e.CellElement.ColumnInfo
Is
GridViewCommandColumn
AndAlso
Not
(
TypeOf
e.CellElement.RowElement
Is
GridTableHeaderRowElement)
Then
Dim
column
As
GridViewCommandColumn =
DirectCast
(e.CellElement.ColumnInfo, GridViewCommandColumn)
If
column.Name =
"PLButton"
Then
Dim
element
As
RadButtonElement =
DirectCast
(e.CellElement.Children(0), RadButtonElement)
element.DisplayStyle = Telerik.WinControls.DisplayStyle.Image
' This is an example of course
element.Image = ImageList.Images(0)
'e.CellElement.StringAlignment = StringAlignment.Center
'Me.ApplyThemeToElement(element, "ControlDefault")
End
If
End
If
End
Sub
Is there anything obvious stands out?
Thanks