Databinding a checkbox in an EditItemTemplate.

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

I have the both of the following lines that do not appear to work. It calls
the binding function but the control when rendered does not carry the
correct checked value:
NOTE: this is within the EditItemTemplate
<asp:CheckBox Text='Active' ID="chkReportActive" Runat=server
Checked='<%#GetCheckedStatusReturnBool(DataBinder.Eval(Container.DataItem,"Active"))%>'
/>
<asp:CheckBox Text='Active' ID="chkReportActive" Runat=server
Checked='<%#DataBinder.Eval(Container.DataItem,"Active")%>' />

Is the Checked attribute not the correct one to use?

Thanks,
Eric
 
The checked attribute is the correct one to use. You can set up a break
point during debugging within the function GetCheckedStatusReturnBool to see
it is working as you expected.
 
Back
Top