# Binding C1CheckBox to a String Field

Learn how to bind C1CheckBox to a String Field.

## Content



To programmatically bind **C1CheckBox** to a String field, use the following code:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
c1CheckBox1.DataSource = dt
c1CheckBox1.DataField = "ColumnString"
c1CheckBox1.DataType = GetType(String)
' Use TranslateValues property to translate string values to/from the check box states. 
c1CheckBox1.TranslateValues.Checked = "Yes"
c1CheckBox1.TranslateValues.Unchecked = "No"
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
c1CheckBox1.DataSource = dt;
c1CheckBox1.DataField = "ColumnString";
c1CheckBox1.DataType = typeof(string);
// Use TranslateValues property to translate string values to/from the check box states. 
c1CheckBox1.TranslateValues.Checked = "Yes";
c1CheckBox1.TranslateValues.Unchecked = "No";
```

DOC-DETAILS-TAG-CLOSE

## See Also

[Binding C1CheckBox to an Integer Field](/componentone/docs/win/online-input/inputforwinformstask/bindingc1checkbox/bindingc1checkboxtoa2)