asp.net.ph

CheckBoxField.DataField Property

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.

Syntax


Inline <asp:checkboxfield datafield = strFieldName ... >
Script CheckBoxField.DataField = strFieldName

Property Value


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.

Remarks

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.

Example

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.

DetailsView AutoGenerateEditButton Example
Run Sample | View Source
See Also

CheckBoxField Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph