hi
I have a table field named" Colour_HEX" that has colors in HEX code in this format #808080. I tried binding it but getting an invalid cast exception error.
These are my code:
<ItemTemplate>
<asp:Label ID="Colour_HEXLabel" runat="server" Width="100px" Height="25px" BackColor='<%# Eval("Colour_HEX") %>'></asp:Label>
</ItemTemplate>
Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 107: </EditItemTemplate>
Line 108: <ItemTemplate>
Line 109: <asp:Label ID="Colour_HEXLabel" runat="server" Width="100px" Height="25px" BackColor='<%# Eval("Colour_HEX") %>'></asp:Label>
Line 110: </ItemTemplate>
Line 111: </telerik:GridTemplateColumn>
How should I solve this? Many thanks
I have a table field named" Colour_HEX" that has colors in HEX code in this format #808080. I tried binding it but getting an invalid cast exception error.
These are my code:
<ItemTemplate>
<asp:Label ID="Colour_HEXLabel" runat="server" Width="100px" Height="25px" BackColor='<%# Eval("Colour_HEX") %>'></asp:Label>
</ItemTemplate>
Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 107: </EditItemTemplate>
Line 108: <ItemTemplate>
Line 109: <asp:Label ID="Colour_HEXLabel" runat="server" Width="100px" Height="25px" BackColor='<%# Eval("Colour_HEX") %>'></asp:Label>
Line 110: </ItemTemplate>
Line 111: </telerik:GridTemplateColumn>
How should I solve this? Many thanks