All docs
V21.1
21.1
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
Tab

ASPxCardViewCardLayoutCreatedEventArgs.FindLayoutItemOrGroup(String) Method

Returns a layout item or group object with the specified name.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.1.dll

Declaration

public LayoutItemBase FindLayoutItemOrGroup(
    string name
)

Parameters

Name Type Description
name String

The layout item or group name.

Returns

Type Description
LayoutItemBase

The layout item or group.

Remarks

Pass the name of a layout item or group to the FindLayoutItemOrGroup(String) method to get and access this layout item.

In the following example, the FindLayoutItemOrGroup method gets a layout group whose name is “DismissalInformation” and makes it visible on the client if a user types a value in the “Dismissal Date” field.

<dx:ASPxCardView ID="cardView" runat="server" OnCardLayoutCreated="cardView_CardLayoutCreated" >
    // ...
    <EditFormLayoutProperties >
        <Items>
            <dx:CardViewTabbedLayoutGroup>
                <Items>
                    <dx:CardViewLayoutGroup ColumnCount="2" Caption="Employee Information">
                        // ...
                    </dx:CardViewLayoutGroup>
                    <dx:CardViewLayoutGroup Caption="Dismissal Information" Name="DismissalInformation">
                        <Items>
                            // ...
                        </Items>
                    </dx:CardViewLayoutGroup>
                </Items>
            </dx:CardViewTabbedLayoutGroup>
        </Items>
    </EditFormLayoutProperties>
</dx:ASPxCardView>
protected void cardView_CardLayoutCreated(object sender, DevExpress.Web.ASPxCardViewCardLayoutCreatedEventArgs e) {
    ASPxCardView cardView = sender as ASPxCardView;
    LayoutGroup layoutGroupDismissal = (LayoutGroup)e.FindLayoutItemOrGroup("DismissalInformation");

    if(layoutGroupDismissal == null) return;
    if(cardView.IsNewCardEditing) {
        layoutGroupDismissal.Visible = false;
        return;
    }
    var fireDate = cardView.GetCardValues(e.CardVisibleIndex, "FireDate");
    layoutGroupDismissal.ClientVisible = fireDate != null && (DateTime)fireDate != DateTime.MinValue;
}
See Also