A
Alan Silver
Hello,
I am data binding a repeater that has a checkbox in the ItemTemplate.
The data value coming out of the database is a char(1) field containing
either "y" or "n". I want to use this value to set/unset the checkbox.
I tried the following in the ItemTemplate...
<asp:CheckBox ID="chkShowNpVar" Text=""
Checked='<%(DataBinder.Eval(Container.DataItem, "showVar")=="y" ? true :
false)%>' RunAt="server"/>
but I got an error...
<%(DataBinder.Eval(Container.DataItem, "showVar")=="y" ? true : false)%>
is not a valid value for Boolean
Any idea why? More to the point, how do I do this? TIA
I am data binding a repeater that has a checkbox in the ItemTemplate.
The data value coming out of the database is a char(1) field containing
either "y" or "n". I want to use this value to set/unset the checkbox.
I tried the following in the ItemTemplate...
<asp:CheckBox ID="chkShowNpVar" Text=""
Checked='<%(DataBinder.Eval(Container.DataItem, "showVar")=="y" ? true :
false)%>' RunAt="server"/>
but I got an error...
<%(DataBinder.Eval(Container.DataItem, "showVar")=="y" ? true : false)%>
is not a valid value for Boolean
Any idea why? More to the point, how do I do this? TIA