Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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 format,
	bool style,
	Object 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<T, TResult>
The function that is used to format the data values that are associated with the WebGridColumn instance.
style
Type: System.Boolean
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.Object
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.

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
Show:
© 2015 Microsoft