WebGrid.Bind Method

Definition

Binds the specified data to the WebGrid instance.

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

Parameters

source
IEnumerable<Object>

The data to display.

columnNames
IEnumerable<String>

A collection that contains the names of the data columns to bind.

autoSortAndPage
Boolean

true to enable sorting and paging of the WebGrid instance; otherwise, false.

rowCount
Int32

The number of rows to display on each page of the grid.

Returns

The bound and populated WebGrid instance.

Applies to