<asp:TemplateColumn >

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All
I'm using Temple column in Asp.Net
if works fine, but I directly want to set the checked property.
With Text Property: it works fin
<asp:TemplateColumn HeaderText="Red Flag"><ItemTemplate><asp:CheckBox Text= '<%# DataBinder.Eval(Container.DataItem, "strRedFlag") %>' runat="server"/></ItemTemplate></asp:TemplateColumn

I want to set lik
In the code below I'm setting the Checked property <asp:CheckBox checked=> instead of Text Property(as in the example above. The code is compiled corretyly. But at run time it gives the Invalid cast exception. My strRedFlag field will return string '0' or '1' In database I have converted that to boolean but it gives the same error. on the form I want to convert it to boolean value. Can any one help me.
<asp:TemplateColumn HeaderText="Red Flag"><ItemTemplate><asp:CheckBox checked= '<%# DataBinder.Eval(Container.DataItem, "strRedFlag") %>' runat="server"/></ItemTemplate></asp:TemplateColumn
Thanks in Advance
Das
 
hi das
i dont think there is any problem.
a wild guess did u turn off the ViewState of the datagrid????
if it is sql server make sure that the field is of bit datatype

HTH
Happy









Das said:
Hi All,
I'm using Temple column in Asp.Net
if works fine, but I directly want to set the checked property.
With Text Property: it works fine
<asp:TemplateColumn HeaderText="Red Flag"><ItemTemplate><asp:CheckBox
Text= ' said:
I want to set like
In the code below I'm setting the Checked property <asp:CheckBox
checked=> instead of Text Property(as in the example above. The code is
compiled corretyly. But at run time it gives the Invalid cast exception. My
strRedFlag field will return string '0' or '1' In database I have converted
that to boolean but it gives the same error. on the form I want to convert
it to boolean value. Can any one help me.
 
Back
Top