editing checkbox in datagrid

M

Mike P

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">
<itemtemplate>
<%#
DataBinder.Eval(Container.DataItem, "DNXLate") %>
</itemtemplate>
<edititemtemplate>
<asp:CheckBox
id="chkDNXLate" runat="server" />
</edititemtemplate>
</asp:templatecolumn>

Update event:

string strDNXLate = ((CheckBox)e.Item.FindControl("chkDNXLate")).Text;

string strCallLogUpdate = "UPDATE CallType SET RSValue = " + strRSValue
+ ", DNXLate = '" + strDNXLate + "', DCUG = " + strDCUG + ", CallType =
" + strCallType + " WHERE Diallednum = '" + strDialledNum + "'";

I think the problem must be where I am converting the value to a string
to put in the database, but I can't figure out how to fix it. Can
anybody help me out?


Thanks,

Mike
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top