Hi,
I have a grid template column that displays one of two images depending on the condition of the field e.g if true show on img if false show off img. Everything worked fine when I was using server side data binding but for unrelated reasons I had to switch to client side data binding and this feature no longer works. I'm getting the following error "Object cannot be cast from DBNull to other types." but there are no nulls in my data table at all. I'd really appreciate some help with this one. Here is the asp:
Thanks,
Ron.
I have a grid template column that displays one of two images depending on the condition of the field e.g if true show on img if false show off img. Everything worked fine when I was using server side data binding but for unrelated reasons I had to switch to client side data binding and this feature no longer works. I'm getting the following error "Object cannot be cast from DBNull to other types." but there are no nulls in my data table at all. I'd really appreciate some help with this one. Here is the asp:
<
telerik:GridTemplateColumn
DataField
=
"Active"
UniqueName
=
"Active"
>
<
ItemStyle
Width
=
"20px"
/>
<
ItemTemplate
>
<
div
class
=
"Tools"
>
<
asp:Image
ID
=
"ImgStatus"
runat
=
"server"
ImageUrl='<%#Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "Active"))? "~/Images/Icons/start.png" :
"~/Images/Icons/stop.png" %>'
AlternateText="Status" ToolTip="Status" onclick="UpdateStatus();" />
</
div
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
Ron.