Skip to content

Commit a79e17e

Browse files
995186-Resolve the ReadMe file length issue in this sample repository
1 parent 131bbda commit a79e17e

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
11
# How-to-bind-winforms-checkboxadv-to-sql-database
2-
This session explains how to bind winforms checkboxadv to sql database
2+
3+
A concise walkthrough to bind the Syncfusion WinForms CheckBoxAdv control to a SQL Server database, including reading and updating a bit/bool field.
4+
5+
## Overview
6+
This sample explains how to:
7+
- Load a boolean/bit value from SQL Server and bind it to CheckBoxAdv
8+
- Support two-state or three-state (Indeterminate) values
9+
- Push user changes back to the database
10+
- Handle DBNull and value mapping scenarios
11+
12+
## Notes on Binding Modes
13+
- Two-state only (true/false):
14+
- Set ThreeState = false
15+
- Bind the "Checked" property: `checkBoxAdv.DataBindings.Add("Checked", current, "IsActive", true, DataSourceUpdateMode.OnPropertyChanged);`
16+
- Three-state (true/false/null):
17+
- Set ThreeState = true
18+
- Bind the "CheckState" property with a null (DBNull) mapping as shown above
19+
20+
## Troubleshooting
21+
- DBNull issues: Use ThreeState and bind to CheckState with a null mapping.
22+
- Update not saving: Ensure your table has a primary key and that SqlCommandBuilder can generate commands.
23+
- Designer toolbox: Install Syncfusion packages and rebuild the project if controls do not appear.
24+
- Connection failures: Validate the connection string and server accessibility.
25+
26+
## About the sample
27+
This sample describes how to bind Syncfusion WinForms CheckBoxAdv to a SQL database within this sample. Adjust namespaces, package versions, and connection strings based on your environment.

0 commit comments

Comments
 (0)