Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Expand]Grid View
  [Expand]Card View
  [Collapse]Vertical Grid
    Overview - VerticalGrid
    Main Features
   [Collapse]Concepts
    [Collapse]Binding to Data
      Binding to Data via Entity Framework (Code First)
      Binding to Data via Entity Framework or LINQ to SQL (Database First)
      Binding to Large Data (Database Server Mode)
     [Collapse]Custom Data Binding
       Custom Data Binding - Overview
       Action Types and Passed Parameters
       Methods to Update the VerticalGrid State in Actions
       ProcessCustomBinding - Available Binding Delegates
       Implementation of Typed Method Delegates
       Custom Binding Limitations
    [Expand]Data Representation Basics
    [Expand]Data Editing and Validation
    [Expand]Focus and Navigation
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]HTML Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Navigation and Layout Extensions
  [Expand]File Management
  [Expand]Multi-Use Site Extensions
  [Expand]Charts
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Tree List
  [Expand]Data Editor Extensions
  [Expand]Report Extensions
  [Expand]SpellChecker
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Implementation of Typed Method Delegates

A call to a VerticalGrid view model's VerticalGridModel.ProcessCustomBinding method in a Controller delegates the implementation of a VerticalGrid view model population to Model-layer functions specified with the method's typed parameters. In general, the VerticalGridModel.ProcessCustomBinding method can accept four parameters that point to method delegates of specific types. This topic describes the available delegate types and provides you with information on how they can be implemented.

Expanded Implementation of the VerticalGridCustomBindingGetDataColumnCountHandler delegate

Method implementation is required.

Always implement this method to return the total number of data columns within your model, taking into account applied filtering (if any).

This method accepts the e parameter of the VerticalGridCustomBindingGetDataColumnCountArgs type, which provides you with the following arguments.

Name Property Description
DataColumnCount VerticalGridCustomBindingGetDataColumnCountArgs.DataColumnCount Gets or sets the total number of data columns within a custom model, taking into account the filtering applied within the VerticalGrid (if any).
FilterExpression VerticalGridCustomBindingArgsBase.FilterExpression Gets the filter condition currently applied to the VerticalGrid (if any filtering is used).
State VerticalGridCustomBindingArgsBase.State Gets an object containing information about the current state on the VerticalGrid.

When implementing this delegate, obtain the total number of columns in your model and assign it to the VerticalGridCustomBindingGetDataColumnCountArgs.DataColumnCount property. The VerticalGrid requires this information to properly calculate the number of pages to be displayed within the pager.

The returned total number should depend upon the filtering conditions (if they were applied to the VerticalGrid). Use the VerticalGridCustomBindingArgsBase.FilterExpression property to obtain the VerticalGrid's filter expression and apply it to your model to obtain the proper number of rows that meet the filter condition. If no filtering is applied, the VerticalGridCustomBindingArgsBase.FilterExpression property returns an empty string.

The common procedure for implementation of this delegate is provided below.

  • Filter your model (if filtering is used) using e.FilterExpression.
  • Obtain the model's total column count and return it to e.DataColumnCount.

Generally, the implementation will look as follows.

Expanded Implementation of the VerticalGridCustomBindingGetDataHandler delegate

Method implementation is required.

Always implement this method to populate the VerticalGrid view model with data columns requested by the extension.

This method accepts the e parameter of the VerticalGridCustomBindingGetDataArgs type, which provides you with the following arguments.

Name Property Description
Data VerticalGridCustomBindingDataArgsBase.Data Gets or sets a list of currently requested model characteristics (depending upon which delegated method is being implemented, it can be a list of data columns, or a list of grouping information objects or a list of calculated summary values).
DataColumnCount VerticalGridCustomBindingGetDataArgs.DataColumnCount Gets the number of currently requested data columns to return.
FilterExpression VerticalGridCustomBindingArgsBase.FilterExpression Gets the filter condition currently applied to the VerticalGrid (if any filtering is used).
StartDataColumnIndex VerticalGridCustomBindingGetDataArgs.StartDataColumnIndex Gets the index of the first column in the requested column list.
State VerticalGridCustomBindingArgsBase.State Gets an object containing information about the current state on the VerticalGrid.

When implementing this delegate, return the requested data columns using the VerticalGridCustomBindingDataArgsBase.Data property.

The common procedure for the implementation of this delegate is provided below.

  • Filter your model (if filtering is used) using e.State.FilterExpression.
  • Sort your model (if sorting is used) using e.State.SortedRows.
  • Obtain the number of columns specified by the e.DataColumnCount starting with e.StartDataColumnIndex, and return the obtained row list to e.Data.

Generally, the implementation will look as follows.

Expanded Implementation of the VerticalGridCustomBindingGetSummaryValuesHandler delegate

Method implementation is optional. It is required if you use summaries within the VerticalGrid.

Provide implementation for this method to calculate and return values of summaries required within the VerticalGrid, taking into account the applied filtering (if any).

This method accepts the e parameter of the VerticalGridCustomBindingGetSummaryValuesArgs type, which provides you with the following arguments.

Name Property Description
Data VerticalGridCustomBindingDataArgsBase.Data Gets or sets a list of currently requested model characteristics (depending upon which delegated method is being implemented, it can be a list of data columns, or a list of grouping information objects or a list of calculated summary values).
FilterExpression VerticalGridCustomBindingArgsBase.FilterExpression Gets the filter condition currently applied to the VerticalGrid (if any filtering is used).
State VerticalGridCustomBindingArgsBase.State Gets an object containing information about the current state on the VerticalGrid.
SummaryItems VerticalGridCustomBindingGetSummaryValuesArgs.SummaryItems Gets a list of summary items which are used within the VerticalGrid and whose values must be calculated.

When implementing this delegate, calculate values for summaries from the VerticalGridCustomBindingGetSummaryValuesArgs.SummaryItems collection, put the calculated summary values in a list, and return this list by setting the VerticalGridCustomBindingDataArgsBase.Data property.

The common procedure for the implementation of this delegate is provided below.

  • Filter your model (if filtering is used) using e.State.FilterExpression.
  • Traverse the e.SummaryItems list, calculate a summary value for each summary item, and return a list of the calculated values to e.Data.

In a general case, the implementation will look as follows.

Expanded Implementation of the VerticalGridCustomBindingGetUniqueHeaderFilterValuesHandler delegate

Method implementation is optional. It is required if you display header filter buttons to use filtering within the VerticalGrid.

Provide implementation for this method to return unique values to be displayed in the header filter dropdown list invoked for a row.

This method accepts the e parameter of the VerticalGridCustomBindingGetUniqueHeaderFilterValuesArgs type, which provides you with the following arguments.

Name Property Description
Data VerticalGridCustomBindingGetUniqueHeaderFilterValuesArgs.Data Gets or sets a list of unique values contained within a specific data field.
FieldName VerticalGridCustomBindingGetUniqueHeaderFilterValuesArgs.FieldName Gets the name of the data field whose unique values should be returned.
FilterExpression VerticalGridCustomBindingArgsBase.FilterExpression Gets the filter condition currently applied to the VerticalGrid (if any filtering is used).
State VerticalGridCustomBindingArgsBase.State Gets an object containing information about the current state on the VerticalGrid.

When implementing this delegate, return a list of unique values obtained from a model data field (specified by the VerticalGridCustomBindingGetUniqueHeaderFilterValuesArgs.FieldName property) to the VerticalGridCustomBindingDataArgsBase.Data property. You may also need to take into account the applied filter condition, which can be obtained using the e.FilterExpression (VerticalGridCustomBindingArgsBase.FilterExpression) or e.State.FilterExpression.

The common procedure for implementation of this delegate is provided below.

  • Filter your model (if filtering is used) using e.FilterExpression.
  • Obtain a list of unique values from a data field specified by e.FieldName and return this list to e.Data.

In most cases, the implementation will look as follows.

Expanded See Also

How would you rate this topic?​​​​​​​