WebGrid.Column Method

Creates a new WebGridColumn instance.

Namespace:  System.Web.Helpers
Assembly:  System.Web.Helpers (in System.Web.Helpers.dll)

public WebGridColumn Column(
	string columnName,
	string header,
	Func<Object, Object> format,
	string style,
	bool canSort
)

Parameters

columnName
Type: System.String
The name of the data column to associate with the WebGridColumn instance.
header
Type: System.String
The text that is rendered in the header of the HTML table column that is associated with the WebGridColumn instance.
format
Type: System.Func<Object, Object>
The function that is used to format the data values that are associated with the WebGridColumn instance.
style
Type: System.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
Type: System.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.

Return Value

Type: System.Web.Helpers.WebGridColumn
The new column.
Show: