Databinding a checkbox in an EditItemTemplate.

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top