asp.net.ph

BoundField.ReadOnly Property

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.

Syntax


Inline <asp:boundfield readonly [ = true | false ] ... >
Script BoundField.ReadOnly [ = true | false ]

Property Value

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.

Remarks

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.

Example

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.

DetailsView AutoGenerateEditButton Example
Run Sample | View Source
See Also

BoundField 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