zoukankan      html  css  js  c++  java
  • DevExpress ASP.NET

    DevExpress ASP.NET MVC Grid View

    supports custom data binding that allows you to perform all data operations,

    such as paging, sorting, filtering, grouping and summary calculation,

    completely by yourself. 

    In this mode, you handle data operations in corresponding Action methods;

    the correspondence is defined by populating the grid's CustomBindingRouteValuesCollection. 

    In each specified Action,

    the processed operation related state information, such as a column state

    (i.e., which column is sorted and in which direction)

    or a pager state (which page is selected), is passed automatically.

    The grid's current state (view model) can be obtained via the static GridViewExtension.

    GetViewModel method and can be updated with the processed operation state. 

    Then, the required data should be provided for the grid 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:

    getDataRowCountMethod of the GridViewCustomBindingGetDataRowCountHandler type Provide implementation for this method to return the total number of data rows. 

    getDataMethod of the GridViewCustomBindingGetDataHandler type Provide implementation for this method to return the required data rows to the grid. 

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

    getGroupingInfoMethod of the GridViewCustomBindingGetGroupingInfoHandler type Provide implementation for this method to return data rows for visible and expanded groups in the required order that depends on the applied grouping and sorting. 

    getUniqueHeaderFilterValuesMethod of the GridViewCustomBindingGetUniqueHeaderFilterValuesHandler 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 grid state (view model) is returned as a model to a view that contains GridView. 

    To bind GridView to this view model, use the BindToCustomData method. 

    This demo shows a simple implementation of custom data binding - only sorting and paging operations are processed.

    Note that when implementing the grid's 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.

  • 相关阅读:
    2017区块链七大趋势,概念热炒之后行业如何发展?
    区块链三大方向:比特币,其他公有链和区块链联盟,以及私有链。
    这条消息被许多人忽视,但对房价可能“一剑封喉”!
    世界主要城市名称中英文对照
    2016全球城市竞争力排行榜
    全球城市群Megalopolis
    gawc全球城市
    2016全球资产配置白皮书(附下载)
    160. Intersection of Two Linked Lists
    save change is not permitted
  • 原文地址:https://www.cnblogs.com/grj001/p/12224725.html
Copyright © 2011-2022 走看看