473,326 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Databinding a checkbox in an EditItemTemplate.

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,"Ac tive")%>' />

Is the Checked attribute not the correct one to use?

Thanks,
Eric
Dec 1 '05 #1
1 2383
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.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Eric" wrote:
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,"Ac tive")%>' />

Is the Checked attribute not the correct one to use?

Thanks,
Eric

Dec 1 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hasden | last post by:
I want to remotely load an edititemtemplate into a formview control. I am currently loading the item templates from .ascx files just fine and they run the <%# Eval() #> stuff and everything is...
0
by: Mike P | last post by:
I am trying to edit a checkbox value in a datagrid. However, whether the user checks the box or not, the field is updated as 'False'. My code is : <asp:TemplateColumn headertext="dnxlate">...
2
by: Martin | last post by:
Hi, Please can somebody explain how databinding is done on a checkbox list. I have the follwoing code which I would have thought was enough to databind a checkbox, but apparently not. The...
1
by: dieter | last post by:
Two-way databinding (as described in http://dotnetjunkies.com/QuickStartv20/aspnet/doc/data/templates.aspx) works fine for me if I use it within aspx-files. However, I would like to use it my...
6
by: hazz | last post by:
ICollection CreateDataSource() { dt.Columns.Add(new DataColumn("ReportInclude", typeof(Boolean))); for (int i=0; i<=10; i++) { dr = dt.NewRow(); dr = 0; dt.Rows.Add(dr); } void...
1
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
2
by: bpd | last post by:
I have a user control embedded in a gridview as an EditItemTemplate. When updating, the value is not saved to the database. I have an SQLDataSource attached to the Gridview. Can someone point me...
10
by: gh | last post by:
I am using VS 2008. I have a gridview with several columns that are checkboxes. The data for each column is either a 1 or 0. When I try to view the page in the browser I get an error "Specified...
1
by: janetb | last post by:
I have a gridview with an update capabilities - a textbox column (roomName), a dropdownlist(orgID), a dropdownlist(roomTypeID),a checkbox column (dialOut), a checkbox column (dialIn). When I try to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.