Tab
A newer version of this page is available. Switch to the current version.

ASPxEdit.ReadOnly Property

Gets or sets a value indicating whether an end-user can change the editor's contents at runtime.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public override bool ReadOnly { get; set; }
Public Overrides Property ReadOnly As Boolean

Property Value

Type Description
Boolean

true, if an end-user cannot change the editor's contents; otherwise, false.

Remarks

Use the ReadOnly property to specify whether the contents of an editor can be modified by an end-user at runtime. For example, setting the ReadOnly property of an ASPxTextBox editor to true, prevents the text displayed within that editor from being changed by an end-user.

Examples

This example demonstrates how to define the read-only style for a text box editor.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
</script>

 <html xmlns="http://www.w3.org/1999/xhtml" >
 <head id="Head1" runat="server">
     <title>Read-Only Style</title>
 </head>
 <body>
     <form id="form1" runat="server">
     <div>
         Default Appearance
         <dxe:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px" Text="Sample text">
         </dxe:ASPxTextBox>
         <br/>
         Read-Only Appearance
         <dxe:ASPxTextBox ID="ASPxTextBox2" runat="server" Width="170px" 
          ReadOnly="True" Text="Sample text">
             <ReadOnlyStyle Cursor="default" ForeColor="#A0A0A0">
                 <Border BorderColor="#D0D0D0" />
             </ReadOnlyStyle>
         </dxe:ASPxTextBox>
     </div>
     </form>
 </body>
 </html>
See Also