System.Web.UI.WebControls Namespace CheckBoxField Class
.NET Framework version 2.0
Sets or retrieves the name of a field in the data source to bind to a CheckBoxField.
Inline |
<asp:checkboxfield datafield = strFieldName ... > |
Script |
CheckBoxField.DataField = strFieldName |
strFieldName |
String specifying the name of a field in the data source to bind to a CheckBoxField. |
The property is read/write with no default value.
Use the DataField property to specify the name of a field from the data source to bind to the CheckBoxField control.
NOTE: Because a check box can display only a selected or an unselected state, a CheckBoxField object can be bound only to a field with a Boolean data type or a string that can be parsed by Parse.
The following example demonstrates how to use the DataField property to specify the name of a field to bind to a CheckBoxField in a DetailsView control.
CheckBoxField Members