Back to Devexpress

ASPxCardViewCardLayoutCreatedEventArgs.FindLayoutItemByColumn(String) Method

aspnet-devexpress-dot-web-dot-aspxcardviewcardlayoutcreatedeventargs-dot-findlayoutitembycolumn-x28-system-dot-string-x29.md

latest2.2 KB
Original Source

ASPxCardViewCardLayoutCreatedEventArgs.FindLayoutItemByColumn(String) Method

Returns a layout item that belongs to the specified column.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public LayoutItem FindLayoutItemByColumn(
    string name_fieldName_caption
)
vb
Public Function FindLayoutItemByColumn(
    name_fieldName_caption As String
) As LayoutItem

Parameters

NameTypeDescription
name_fieldName_captionString

The field name.

|

Returns

TypeDescription
LayoutItem

The layout item.

|

Remarks

Pass a column’s field name or a caption to the FindLayoutItemByColumn(String) method to get a layout item that belongs to the specified column.

The following example illustrates how to use the FindLayoutItemByColumn method.

csharp
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;
        }
    }
}

See Also

ASPxCardViewCardLayoutCreatedEventArgs Class

ASPxCardViewCardLayoutCreatedEventArgs Members

DevExpress.Web Namespace