Hi I have a scheduler thaat utilises a appointment template. I need the appointment to display a graphic if the appointment has not yet been completed.
This is worked out with my SQL datasource and a field is returned called "IsNotComplete", this feild is a boolean which obviously returns true/false.
I then have set the scheduler to utilise this field in the CustomAttributeNames section.
I then coded the following inside the scheduler
When I open the page in my browser(IE7) I get the following message "Specified Cast Is Invalid". I then adjusted my code to display the content of the eval statement like so:
The page is then viewable and the value on the apointments clearly shows either "True" or "False".
I then reverted to the first code snippet (top) and added visible='<%# (bool)Eval("IsNotComplete") %>' just incase there was some kind of casting problem but it still errored with "Specified Cast Invalid"
My question is why does the true/false value cause a cast issue? Is there any where of fixing it?
This is worked out with my SQL datasource and a field is returned called "IsNotComplete", this feild is a boolean which obviously returns true/false.
I then have set the scheduler to utilise this field in the CustomAttributeNames section.
I then coded the following inside the scheduler
<AppointmentTemplate > |
<TABLE cellSpacing=0 cellPadding=0 width="100%"> |
<TBODY><TR><TD><%# Eval("Subject") %></TD> |
<TD vAlign=top> |
<asp:Image id="AppointmentNotComplete" runat="server" ImageUrl="~/Images/warning_icon.gif" ToolTip="Incomplete" |
Visible='<%# Eval("IsNotComplete") %>' |
ImageAlign="Top"></asp:Image> |
</TD></TR></TBODY></TABLE> |
</AppointmentTemplate> |
<AppointmentTemplate > |
<TABLE cellSpacing=0 cellPadding=0 width="100%"> |
<TBODY><TR><TD><%# Eval("IsNotComplete") %> |
</br> |
<%# Eval("Subject") %></TD> |
<TD vAlign=top> |
<asp:Image id="AppointmentNotComplete" runat="server" ImageUrl="~/Images/warning_icon.gif" ToolTip="Incomplete" |
Visible='true' |
ImageAlign="Top"></asp:Image> |
</TD></TR></TBODY></TABLE> |
</AppointmentTemplate> |
I then reverted to the first code snippet (top) and added visible='<%# (bool)Eval("IsNotComplete") %>' just incase there was some kind of casting problem but it still errored with "Specified Cast Invalid"
My question is why does the true/false value cause a cast issue? Is there any where of fixing it?