WebGrid.Bind(IEnumerable<Object>, IEnumerable<String>, Boolean, Int32) WebGrid.Bind(IEnumerable<Object>, IEnumerable<String>, Boolean, Int32) WebGrid.Bind(IEnumerable<Object>, IEnumerable<String>, Boolean, Int32) 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 = null, 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 Boolean Boolean

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

rowCount
Int32 Int32 Int32

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

Returns

The bound and populated WebGrid instance.

Applies to