Skip to main content
All docs
V24.1

Troubleshooting

Issue:

The form layout displays empty spaces in items.

Solution

The ASPxFormLayout control renders additional empty space that is reserved for a validation error message. To avoid this behavior, set the editor’s Display property to Dynamic. In this case, the error message is rendered dynamically when the editor fails validation.

Form Layout Display Modes

<dx:LayoutGroup Caption="Personal Information" ColCount="2">
    <Items>
        <dx:LayoutItem Caption="First Name" FieldName="FirstName">
            <LayoutItemNestedControlCollection>
                <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                    <dx:ASPxTextBox ID="firstNameTextBox" runat="server" Width="100%">
                        <ValidationSettings RequiredField-IsRequired="true" Display="Dynamic" />
                    </dx:ASPxTextBox>
                </dx:LayoutItemNestedControlContainer>
            </LayoutItemNestedControlCollection>
        </dx:LayoutItem>
        <dx:LayoutItem Caption="Last Name" FieldName="LastName">
            <LayoutItemNestedControlCollection>
                <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                    <dx:ASPxTextBox ID="lastNameTextBox" runat="server" Width="100%" />
                </dx:LayoutItemNestedControlContainer>
            </LayoutItemNestedControlCollection>
        </dx:LayoutItem>
        <dx:LayoutItem Caption="Birth Date" FieldName="BirthDate">
            <LayoutItemNestedControlCollection>
                <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                    <dx:ASPxDateEdit ID="birthDateEdit" runat="server" />
                </dx:LayoutItemNestedControlContainer>
            </LayoutItemNestedControlCollection>
        </dx:LayoutItem>
    </Items>
</dx:LayoutGroup>