Tab

ASPxCardViewCardLayoutCreatedEventArgs Class

Provides data for the ASPxCardView.CardLayoutCreated event.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

Declaration

public class ASPxCardViewCardLayoutCreatedEventArgs :
    EventArgs

Remarks

Use the ASPxCardViewCardLayoutCreatedEventArgs object to access and modify the event's data.

The following example illustrates how to use the FindLayoutItemByColumn(String) method to find layout items that belong to the specified columns and then change their visibility and column span if a card is in edit mode.

Web Forms:

protected void ASPxCardView1_CardLayoutCreated(object sender, ASPxCardViewCardLayoutCreatedEventArgs e) {
    // Applies the card layout to the Edit Form only
    if(e.IsEditingCard) {
        ASPxCardView cardView = sender as ASPxCardView;
        if(cardView.IsNewCardEditing) {
            LayoutItem itemOrderID = e.FindLayoutItemByColumn(cardView.KeyFieldName);
            itemOrderID.ClientVisible = false;
            LayoutItem itemProductName = e.FindLayoutItemByColumn("ProductName");
            itemProductName.ColumnSpan = 2;
        }
    }
}

MVC:

var cardView = Html.DevExpress().CardView(settings =>
{
    settings.Name = "CardView";
    //...
    settings.CardLayoutCreated = (s, e) =>
    {
        // Applies the card layout to the Edit Form only
        if(e.IsEditingCard) {
            ASPxCardView cardView = sender as ASPxCardView;
            if(cardView.IsNewCardEditing) {
                LayoutItem itemOrderID = e.FindLayoutItemByColumn(cardView.KeyFieldName);
                itemOrderID.ClientVisible = false;
                LayoutItem itemProductName = e.FindLayoutItemByColumn("ProductName");
                itemProductName.ColumnSpan = 2;
            }
        }
    };
});

Inheritance

See Also