WebGrid.Column Method

Definition

Creates a new WebGridColumn instance.

public System.Web.Helpers.WebGridColumn Column (string columnName = default, string header = default, Func<dynamic,object> format = default, string style = default, bool canSort = true);
member this.Column : string * string * Func<obj, obj> * string * bool -> System.Web.Helpers.WebGridColumn
Public Function Column (Optional columnName As String = null, Optional header As String = null, Optional format As Func(Of Object, Object) = null, Optional style As String = null, Optional canSort As Boolean = true) As WebGridColumn

Parameters

columnName
String

The name of the data column to associate with the WebGridColumn instance.

header
String

The text that is rendered in the header of the HTML table column that is associated with the WebGridColumn instance.

format
Func<Object,Object>

The function that is used to format the data values that are associated with the WebGridColumn instance.

style
String

A string that specifies the name of the CSS class that is used to style the HTML table cells that are associated with the WebGridColumn instance.

canSort
Boolean

true to enable sorting in the WebGrid instance by the data values that are associated with the WebGridColumn instance; otherwise, false. The default is true.

Returns

The new column.

Applies to