Skip to main content
A newer version of this page is available. .

PasswordBoxEdit

  • 2 minutes to read

Overview

The PasswordBoxEdit control is an advanced text box designed for entering private information.

PasswordBox_NullText

The PasswordBoxEdit control offers the following features.

  • Configurable password char

    Use the PasswordBoxEdit.PasswordChar property to choose a character that is displayed within the editor’s text box.

    PasswordBoxEdit_PswdChar

  • Optional null text

    Use the PasswordBoxEdit‘s BaseEdit.NullText property to specify the null text. The null text is displayed to the user when the password box is empty.

  • Configurable maximum password length

    Use the PasswordBoxEdit‘s TextEditBase.MaxLength property to limit the length of the password.

  • Password strength estimation

    Use the editor’s PasswordBoxEdit.PasswordStrength property to display the estimated strength of the entered password.

    <dxe:PasswordBoxEdit Name="pb"/>
    <Label Content="{Binding ElementName=pb, Path=PasswordStrength}"/>
    

    You can estimate password strength manually using the PasswordBoxEdit.CustomPasswordStrength event.

  • Input validation

    Advanced data validation capabilities

    PasswordBox_Validation

  • Optimized for in-place editing

    PasswordBoxEdit can be used standalone or as an in-place editor nested in a container control. The PasswordBoxEditSettings class implements the in-place editing functionality. See In-place Editors to learn more.

Standalone PasswordBoxEdit

To add a standalone PasswordBoxEdit to a Window, drag it from the Toolbox.

The following sample demonstrates how to create a PasswordBoxEdit using XAML markup.

<dxe:PasswordBoxEdit PasswordChar="#" NullText="Enter your password" MaxLength="8"/>

In-place PasswordBoxEdit

To embed a PasswordBoxEdit into a container control, use the PasswordBoxEditSettings class.

The following sample demonstrates how to embed a PasswordBoxEdit into a GridControl column.

<dxg:GridControl>
    <dxg:GridColumn FieldName="Password">
        <dxg:GridColumn.EditSettings>
            <dxe:PasswordBoxEditSettings PasswordChar="#" NullText="Enter your password..." MaxLength="8"/>
        </dxg:GridColumn.EditSettings>
    </dxg:GridColumn>
    <dxg:GridControl.View>
        <dxg:TableView/>
    </dxg:GridControl.View>
</dxg:GridControl>