THEMES
THEME SETTINGS

Card View - Data Binding and Summaries Column Binding via Lambdas

Contact Name:Alejandra Camino
Company Name:Romero y tomillo
Country:Spain
City:Madrid
Region: 
Contact Name:Alexander Feuer
Company Name:Morgenstern Gesundkost
Country:Germany
City:Leipzig
Region: 
Contact Name:Ana Trujillo
Company Name:Ana Trujillo Emparedados y helados
Country:Mexico
City:México D.F.
Region: 
Contact Name:Anabela Domingues
Company Name:Tradição Hipermercados
Country:Brazil
City:Sao Paulo
Region:SP
Contact Name:André Fonseca
Company Name:Gourmet Lanchonetes
Country:Brazil
City:Campinas
Region:SP
Contact Name:Ann Devon
Company Name:Eastern Connection
Country:United Kingdom
City:London
Region: 
Contact Name:Annette Roulet
Company Name:La maison d'Asie
Country:France
City:Toulouse
Region: 
Contact Name:Antonio Moreno
Company Name:Antonio Moreno Taquería
Country:Mexico
City:México D.F.
Region: 
Contact Name:Aria Cruz
Company Name:Familia Arquibaldo
Country:Brazil
City:Sao Paulo
Region:SP
Page 1 of 11 (91 items)Prev123456791011Next

This demo illustrates how to bind CardView columns to Model fields using lambda expressions.

To enable binding CardView columns to Model fields using lambdas, you must declare the CardView extension using the ExtensionsFactory.CardView<CardType> strongly-typed declaration method. This method accepts the CardViewSettings<CardType> object that implements the following specific strongly-typed members.

  • KeyFields.This method defines a key field (or multiple fields for a composite key). In this demo, the key field name is defined using the lambda expression passed as a parameter to the KeyFields method.

  • Columns. This property provides access to a collection of strongly-types columns. This collection exposes the specific Add method that accepts the lambda expression that defines a particular model field to which the newly created column will be bound.

    The specific Add method overload can also accept the delegate method that returns the column settings object. This overload allows you to add a column with specific settings (see the "Contact Name" column in this demo).

Note that the partial View with the CardView extension does not need to be strongly-typed.

Version: v2016 vol 2.6
Copyright © 2006-2017 Developer Express Inc
Your Next Great MVC App Starts Here

Get started today and download your 30-day trial of DevExpress MVC Extensions (includes 30 days of free technical support).

All demos ship with full source code and are included in the DevExpress MVC distribution. Refer to the Demos and Sample Applications topic to learn more.

DevExpress MVC Extensions ship as part of DevExpress Universal, DXperience and ASP.NET Subscriptions and are backed by a 60 day unconditional money-back guarantee.
To learn more and obtain pricing information, visit the Compare Features and Pricing webpage. For immediate assistance, contact us by Email at info@devexpress.com or by phone at +1 (818) 844-3383 between 7:30am and 4:30pm Pacific Time.