BootstrapCardViewBuilderBase<T>.Columns(Action<BootstrapCardViewColumnCollectionBuilder>) Method

Provides access to the Card View column collection.

Namespace: DevExpress.AspNetCore.Bootstrap

Assembly: DevExpress.AspNetCore.Bootstrap.v18.1.dll

Declaration

public T Columns(
    Action<BootstrapCardViewColumnCollectionBuilder> config
)
Public Function Columns(
    config As Action(Of BootstrapCardViewColumnCollectionBuilder)
) As T

Parameters

Type Name Description
System.Action<BootstrapCardViewColumnCollectionBuilder> config

An Action that configures the BootstrapCardViewColumnCollectionBuilder's functionality.

Returns

Type Description
T

A reference to this instance after the operation is completed.

The Card View control stores its data columns in the Columns collection. Each column corresponds to a Card View item.

Use the Add method to add a column to a Card View's column collection.

@using EditableTask = DevExpress.AspNetCore.DemoModels.Task
@model IEnumerable<EditableTask>
@(Html.DevExpress()
    .BootstrapCardView<EditableTask>("cardViewWithDataColumn")
    .Columns(columns => {
        columns.Add(m => m.Name);
        columns.Add(m => m.StartDate);
        columns.Add(m => m.EndDate);
        columns.Add(m => m.Done);
    })
    .Routes(routes => routes
        .MapRoute(r => r
            .Controller("CardView")
            .Action("CardViewPartial")))
    .Bind(Model))

For more information on available Card View column types, refer to the Column Types online demo.