Back to Devexpress

ASPxEditBase.ClientEnabled Property

aspnet-devexpress-dot-web-dot-aspxeditbase-a0343d43.md

latest6.2 KB
Original Source

ASPxEditBase.ClientEnabled Property

Gets or sets a value that indicates whether an editor is enabled on the client.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(true)]
public bool ClientEnabled { get; set; }
vb
<DefaultValue(True)>
Public Property ClientEnabled As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if an editor is enabled; otherwise, false.

|

Remarks

Use the ClientEnabled property to specify an editor’s ability to respond to user interactions, such as mouse clicks or text input. An editor’s availability state, defined by this property, can then be dynamically changed on the client side using the ASPxClientEditBase.SetEnabled method.

Note

The ClientEnabled property is not in effect if an editor is disabled on the server side by using the server Enabled property.

Important

Values of disabled inputs are not submitted.

Example

The complete sample project is available in the DevExpress Code Central database: How to add buttons to a pop-up window.

cshtml
<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px" ClientInstanceName="txtMain"
    ClientEnabled="False" Text="test message">
</dx:ASPxTextBox>
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Edit..." AutoPostBack="False">
    <ClientSideEvents Click="function(s, e) { txtPopup.SetText(txtMain.GetText()); popupControl.Show(); }" />
</dx:ASPxButton>
<dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" ClientInstanceName="popupControl"
    Height="83px" Modal="True" CloseAction="CloseButton" Width="207px" AllowDragging="True"
    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter">
    <ContentCollection>
        <dx:PopupControlContentControl runat="server">
            Text:<dx:ASPxTextBox ID="ASPxTextBox2" runat="server" Width="170px" ClientInstanceName="txtPopup">
            </dx:ASPxTextBox>
            

            

            <table style="border: none">
                <tr>
                    <td>
                        <dx:ASPxButton ID="btnOK" runat="server" AutoPostBack="False" Text="OK" Width="80px"
                            OnClick="btnOK_Click">
                            <ClientSideEvents Click="function(s, e) { popupControl.Hide();
                                    // Processes data on the client
                                    e.processOnServer = true;
                                    // Processes data on the server
                                }" />
                        </dx:ASPxButton>
                    </td>
                    <td>
                        <dx:ASPxButton ID="btnCancel" runat="server" AutoPostBack="False" ClientInstanceName="btnCancel"
                            Text="Cancel" Width="80px">
                            <ClientSideEvents Click="function(s, e) { popupControl.Hide(); }" />
                        </dx:ASPxButton>
                    </td>
                </tr>
            </table>
        </dx:PopupControlContentControl>
    </ContentCollection>
</dx:ASPxPopupControl>

The following code snippets (auto-collected from DevExpress Examples) contain references to the ClientEnabled property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-show-a-hyper-link-url-email-etc-for-a-business-class-property/CS/HyperLinkPropertyEditor.Web/WebHyperLinkStringPropertyEditor.cs#L82

csharp
if(ASPxEditor is ASPxHyperLink) {
    ASPxEditor.ClientEnabled = true;
}

xaf-how-to-display-a-collection-property-as-a-checked-list-box/CS/DXExample.Module.Web/WebCheckedListBoxPropertyEditor.cs#L24

csharp
ASPxCheckBoxList control = new ASPxCheckBoxList();
control.ClientEnabled = false;
return control;

xaf-how-to-show-a-hyper-link-url-email-etc-for-a-business-class-property/VB/HyperLinkPropertyEditor.Web/WebHyperLinkStringPropertyEditor.vb#L83

vb
If TypeOf ASPxEditor Is ASPxHyperLink Then
    ASPxEditor.ClientEnabled = True
End If

xaf-how-to-display-a-collection-property-as-a-checked-list-box/VB/DXExample.Module.Web/WebCheckedListBoxPropertyEditor.vb#L26

vb
Dim control As New ASPxCheckBoxList()
control.ClientEnabled = False
Return control

See Also

ASPxEditBase Class

ASPxEditBase Members

DevExpress.Web Namespace