MMIMadness
Technical User
hi all,
i have a data grid with one of the columns getting it feed from a TRUE/FALSE data field.
what i want to do is display a set image when the value is true and no image when it's false.
i have made the column a template field and added the image to the field, with the view of turning it on and off in code.
Item template
Event code
but as yet just can't crack it. Any ideas would be great.
i have a data grid with one of the columns getting it feed from a TRUE/FALSE data field.
what i want to do is display a set image when the value is true and no image when it's false.
i have made the column a template field and added the image to the field, with the view of turning it on and off in code.
Item template
Code:
<ItemTemplate>
<asp:Image ID="Image1" runat="server" Height="17px" ImageUrl="yesno.jpg" Width="19px" />
</ItemTemplate>
Event code
Code:
Public Function yesno(ByVal strdate As String) As String
Dim image1 As Image
image1 = CType(FindControl("image1"), Image)
If strdate = True Then
image1.Visible = True
Else
image1.Visible = False
End If
End Function
but as yet just can't crack it. Any ideas would be great.