I'm new to the grid so please bear with me. I've got a GridTemplateColumn which I'm using to display an image.
This shouldn't be visible if the data is empty, so in the ItemDataBound method, I did
And this worked just fine under FireFox. But with IE8, it doesn't. Instead, I had to move this to the PreRender method where I had to iterate through the items with the same logic to get it to work. And this approach also works fine under FireFox too, so that's good.
But since I'm new to the grid, I'm wondering, is there a "correct" or recommended place to do this kind of logic? I initially went with the ItemDataBound because that's where similar approaches that I'd found (e.g. here ) had done it. But that obviously didn't work for me with IE8.
<
telerik:GridTemplateColumn
HeaderText
=
"Address"
UniqueName
=
"Address"
ItemStyle-Width
=
"20"
>
<
ItemTemplate
>
<
a
href='<%# Eval("Address") %>' title='<%# Eval("Address") %>'><
img
src
=
"images/go.gif"
border
=
"0"
width
=
"33"
></
a
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Dim
item
As
GridDataItem =
CType
(e.Item, GridDataItem)
If
condition
Then
item(
"Address"
).Controls(0).Visible =
False
End
If
But since I'm new to the grid, I'm wondering, is there a "correct" or recommended place to do this kind of logic? I initially went with the ItemDataBound because that's where similar approaches that I'd found (e.g. here ) had done it. But that obviously didn't work for me with IE8.