WebGrid.Column Method
Creates a new WebGridColumn instance.
Namespace: System.Web.Helpers
Assembly: System.Web.Helpers (in System.Web.Helpers.dll)
Syntax
'Declaration
Public Function Column ( _
columnName As String, _
header As String, _
format As Func(Of Object, Object), _
style As String, _
canSort As Boolean _
) As WebGridColumn
'Usage
Dim instance As WebGrid
Dim columnName As String
Dim header As String
Dim format As Func(Of Object, Object)
Dim style As String
Dim canSort As Boolean
Dim returnValue As WebGridColumn
returnValue = instance.Column(columnName, _
header, format, style, canSort)
public WebGridColumn Column(
string columnName,
string header,
Func<Object, Object> format,
string style,
bool canSort
)
public:
WebGridColumn^ Column(
String^ columnName,
String^ header,
Func<Object^, Object^>^ format,
String^ style,
bool canSort
)
member Column :
columnName:string *
header:string *
format:Func<Object, Object> *
style:string *
canSort:bool -> WebGridColumn
public function Column(
columnName : String,
header : String,
format : Func<Object, Object>,
style : String,
canSort : boolean
) : WebGridColumn
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.