THEMES
THEME SETTINGS

Card View - Data Binding and Summaries Custom Data Binding

Operation:  
Time taken:   ms
x
From Not filtered
Subject Not filtered
Sent Not filtered
Size Not filtered
Has Attachment Not filtered
From:Mike Roller
Size:126000
Sent:4/3/2016
Subject:Email Attachments. Is it possible to add multiple attachments? I haven't found a way to do this.
From:Dave Murrel
Size:117226
Sent:2/22/2016
Subject:Currency Mask. The current currency mask in completely unusable.
From:Andrew Miller
Size:129134
Sent:4/3/2016
Subject:Email Attachments. Is it possible to add multiple attachments? I haven't found a way to do this.
From:Ryan Fischer
Size:76309
Sent:3/16/2016
Subject:Receivables Calculator. Where can I find the complete specs?
From:Steve Lee
Size:192165
Sent:3/7/2016
Subject:Data Import. What database types will we support?
From:Richard Fisher
Size:61940
Sent:2/26/2016
Subject:Screen Redraw. Somebody has to look at it.
From:Mike Roller
Size:41523
Sent:3/18/2016
Subject:Web Edition: Data Entry Page. There is an issue with date validation.
From:Mark Hamilton
Size:213819
Sent:3/19/2016
Subject:Main Menu: Add a File menu. File menu item is missing.
From:Ray Shipman
Size:263934
Sent:2/25/2016
Subject:History. Will we track sales history in our system?
Sum of Size is 45367729553;
Count=300,000
Page 1 of 33334 (300000 items)Prev1234567333323333333334Next
Show filter builder dialogCreate Filter 

DevExpress ASP.NET MVC Card View supports custom data binding that allows you to perform all data operations, such as paging, sorting, filtering and summary calculation, completely by yourself.

In this mode, you handle data operations in corresponding Action methods; the correspondence is defined by populating the extension’s CustomBindingRouteValuesCollection.

InIn each specified Action, the processed operation related state information, such as a column’s state (i.e., which column is sorted and in which direction) or a pager’s state (which page is selected), is passed automatically. The CardView’s current state (view model) can be obtained through the static CardViewExtension.GetViewModel method and can be updated with the processed operation state. Then, the required data should be provided for the CardView view model via a call to its ProcessCustomBinding method.

The ProcessCustomBinding method has several overloads. You can select a particular one depending on which data operations you need to handle.

Generally, this method provides the following parameters representing typed method delegates:

getDataCardCountMethod of the CardViewCustomBindingGetDataCardCountHandler type
Provide implementation for this method to return the total number of data cards.

getDataMethod of the CardViewCustomBindingGetDataHandler type
Provide implementation for this method to return the required data cards to the CardView.

getSummaryValuesMethod of the CardViewCustomBindingGetSummaryValuesHandler type
Provide implementation for this method to calculate and return values of summaries required within the CardView.

getUniqueHeaderFilterValuesMethod of the CardViewCustomBindingGetUniqueHeaderFilterValuesHandler type
Provide implementation for this method to return unique values to be displayed in the header filter popup list invoked for a column.

The resulting CardView state (view model) is returned as a model to a view that contains the CardView. To bind the CardView to this view model, use the BindToCustomData method.

This demo shows an advanced implementation of custom data binding - all data operations are processed (in particular: sorting, paging, summary calculations and filtering including column header filter invocation).

Note that when implementing CardView custom data binding, the DevExpressEditorsBinder must be used instead of the default model binder to correctly transfer values from DevExpress editors back to the corresponding data model fields. In this demo, the DevExpressEditorsBinder is assigned to the ModelBinders.Binders.DefaultBinder property within the Global.asax file, thus overriding the default model binder.

Version: v2016 vol 2.4
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.