BuilderFactoryExtensions.BootstrapCardView(BuilderFactory) Method

Creates a Card View control.

Namespace: DevExpress.AspNetCore

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

Declaration

public static BootstrapCardViewBuilder BootstrapCardView(
    this BuilderFactory builderFactory
)
<ExtensionAttribute>
Public Shared Function BootstrapCardView(
    builderFactory As BuilderFactory
) As BootstrapCardViewBuilder

Parameters

Type Name Description
BuilderFactory builderFactory

A BuilderFactory object providing access to Card View settings.

Returns

Type Description
BootstrapCardViewBuilder

A builder for a Card View control.

The code sample below demonstrates how you can use this method to create a Card View control.

@model IEnumerable

@(Html.DevExpress()
    .BootstrapCardView<SalesProduct>()
    .KeyFieldName(m => m.ProductID)
    .Columns(columns => {
        columns.Add(m => m.ProductName);
        columns.Add(m => m.QuantityPerUnit);
        columns.Add()
            .FieldName("UnitPrice");
        columns.Add()
            .FieldName("UnitsOnOrder");
        columns.AddTextColumn()
            .FieldName("Total")
            .UnboundType(UnboundColumnType.Decimal)
            .UnboundExpression("UnitsOnOrder * UnitPrice")
            .PropertiesTextEdit(properties => properties
                .DisplayFormatString("c"));
    })
    .Routes(routes => routes
        .MapRoute(r => r
            .Action("Binding")
            .Controller("CardView")))

    .Bind(Model))

See Also