System.Web.UI.WebControls Namespace BoundField Class
.NET Framework version 2.0
Sets or retrieves a value indicating whether the value of a BoundField can be modified in edit mode.
Inline |
<asp:boundfield readonly [ = true | false ] ... > |
Script |
BoundField.ReadOnly [ = true | false ] |
This property accepts or returns only a boolean value: true to prevent the value of the field from being modified in edit mode; otherwise false. Default value is false.
Use the ReadOnly property to prevent the values displayed in a BoundField from being modified when in edit mode. When a data-bound control is in edit mode, fields that are read-only are displayed as plain text, without any editing controls.
NOTE: The ReadOnly property applies only to edit mode. To prevent fields from showing up in insert mode, use the InsertVisible property.
The following example demonstrates how to set the ReadOnly property at design time, to prevent modification to the data in a BoundField control when in edit mode.
BoundField Members