I have a telerik:GridTemplateColumn in which I have placed an asp:image control (see code segment)
I want to change the asp:image ImageUrl programatically in the ItemDataBound event. The ItemDataBound GridItemEventArgs is "e".
I can access properties of this cell in a row as "e.item.cells[14]" and change its Backcolor:
What syntax can I use to change the image url in this cell?
<
telerik:GridTemplateColumn
HeaderText
=
"Status"
UniqueName
=
"TemplateColumn"
>
<
HeaderStyle
Font-Bold
=
"True"
Font-Size
=
"Medium"
HorizontalAlign
=
"Left"
VerticalAlign
=
"Middle"
Width
=
"4%"
/>
<
ItemStyle
Font-Size
=
"Medium"
HorizontalAlign
=
"Center"
VerticalAlign
=
"Middle"
/>
<
ItemTemplate
>
<
asp:Image
ID
=
"Image1"
runat
=
"server"
ImageUrl
=
"~/images/redlight.gif"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
I want to change the asp:image ImageUrl programatically in the ItemDataBound event. The ItemDataBound GridItemEventArgs is "e".
I can access properties of this cell in a row as "e.item.cells[14]" and change its Backcolor:
e.Item.Cells[14].BackColor = System.Drawing.Color.Red;
What syntax can I use to change the image url in this cell?