G
Guest
I am looking for assistance in pinpointing the cause of the following
exception. I am getting a "Specified Cast is not valid" exception on my
page. I am trying to populate a datagrid. One of my columns is a template
column where I'd like to evaluate the data brought back from the db and
populate the column with a "Y" or "N" depending on the value in the db. Here
is the code that is causing it as well as the error (below).
ERROR MESSAGE:
Specified cast is not valid
Exception Details: System.InvalidCastException: Specified cast is not valid.
<%# ((bool)DataBinder.Eval(Container.DataItem, "ReportsTo")) == false ? "N"
: "Y" %>
Code (in aspx page):
<asp:TemplateColumn HeaderText="Reports To" >
<ItemTemplate>
<%# ((bool)DataBinder.Eval(Container.DataItem, "ReportsTo")) == false ?
"N" : "Y" %>
</ItemTemplate>
</asp:TemplateColumn>
exception. I am getting a "Specified Cast is not valid" exception on my
page. I am trying to populate a datagrid. One of my columns is a template
column where I'd like to evaluate the data brought back from the db and
populate the column with a "Y" or "N" depending on the value in the db. Here
is the code that is causing it as well as the error (below).
ERROR MESSAGE:
Specified cast is not valid
Exception Details: System.InvalidCastException: Specified cast is not valid.
<%# ((bool)DataBinder.Eval(Container.DataItem, "ReportsTo")) == false ? "N"
: "Y" %>
Code (in aspx page):
<asp:TemplateColumn HeaderText="Reports To" >
<ItemTemplate>
<%# ((bool)DataBinder.Eval(Container.DataItem, "ReportsTo")) == false ?
"N" : "Y" %>
</ItemTemplate>
</asp:TemplateColumn>