WebGrid.Bind 方法

定义

将指定数据绑定到 WebGrid 实例。

public System.Web.Helpers.WebGrid Bind(System.Collections.Generic.IEnumerable<dynamic> source, System.Collections.Generic.IEnumerable<string> columnNames = default, bool autoSortAndPage = true, int rowCount = -1);
member this.Bind : seq<obj> * seq<string> * bool * int -> System.Web.Helpers.WebGrid
Public Function Bind (source As IEnumerable(Of Object), Optional columnNames As IEnumerable(Of String) = null, Optional autoSortAndPage As Boolean = true, Optional rowCount As Integer = -1) As WebGrid

参数

source
IEnumerable<Object>

要显示的数据。

columnNames
IEnumerable<String>

包含要绑定的数据列的名称的集合。

autoSortAndPage
Boolean

如果为 true,则启用实例的 WebGrid 排序和分页;否则为 false。

rowCount
Int32

要在网格的每个页上显示的行的数量。

返回

绑定和填充的 WebGrid 实例。

适用于