<asp:TemplateField HeaderText="Grabbelpas">
<ItemTemplate>
<asp:CheckBox id="lblGrabbelpas" Enabled="false" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.Grabbelpas") %>' ></asp:CheckBox>
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox id="txtEditGrabbelpas" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.Grabbelpas") %>' />
</EditItemTemplate>
</asp:TemplateField>
CheckBox txtGrabbelpas = (CheckBox)(myDetailsView.FindControl("txtEditGrabbelpas"));
strSQL = "UPDATE leden SET LidID = "Grabbelpas = '" + txtGrabbelpas.Checked + "' " +
" WHERE LidID = '" + userID + "'";
When i go to my detailsview itemtemplate, the checkbox returns the value correct, but every time i update it, it always returns 0.
I'm using a MySQL db and the type of "grabbelpas" is tinyint(1).
If more code is needed just ask. But my other textboxes are updated correctly, it's just the checkbox that doesnt update well.