Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 9th, 2004, 06:13 AM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Databinding: Addnew with checkbox on form

Hi,

I have a problem with a dataform Application using c# and MS SQL Server 2000.
If I only have Textboxes on my form everything works fine (Navigation, Update, Add, Delete).
When I also have a checkbox on my form which refers to a TINYINT field in my DB I cant add a new row. Updating and Navigation works fine.
When I hit the ADD button on my form the fields does not clean up the fields – even the textfield have their old values.

Code for binding the checkbox:
  chkFieldValue[curCol].DataBindings.Add("Checked", DS_SelTable,
                     "SelTable." + ColName);

Code for the add-button:
  BindingContext[DS_SelTable,"SelTable"].AddNew();

Can anyone help ?

Thanks
Frank


 
Old April 7th, 2004, 11:06 AM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Frank,
I found the answer here:
http://www.syncfusion.com/forums/mes...MessageID=2040
You just need to set the default values for the specific data fields to "false" in the dataset definition (ds.xsd).
Eumel71






Similar Threads
Thread Thread Starter Forum Replies Last Post
using checkbox in login form remember me next tim avnishraj23 ASP.NET 2.0 Basics 1 December 4th, 2007 08:36 PM
Enabling form elements on click of checkbox Shuchik Classic ASP Basics 2 September 12th, 2007 02:53 AM
"Insert into - checkbox value" Form connection jb_norman PHP Databases 0 July 30th, 2006 06:26 AM
Change form ACTION value from checkbox value Nazz Javascript 3 March 10th, 2005 11:50 AM
C# reset of checkbox after form submission booksnore2 General .NET 5 July 29th, 2004 10:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.