WebGrid.Column 方法

定義

建立新的 WebGridColumn 執行個體。

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

參數

columnName
String

要與 WebGridColumn 實例產生關聯的資料行名稱。

header
String

與 實例相關聯之 HTML 資料表資料行標頭中轉譯的 WebGridColumn 文字。

format
Func<Object,Object>

用來格式化與 WebGridColumn 實例相關聯之資料值的函式。

style
String

字串,指定 CSS 類別的名稱,用來設定與 實例相關聯之 HTML 表格儲存格的 WebGridColumn 樣式。

canSort
Boolean

true 表示啟用實例中 WebGrid 與實例相關聯的 WebGridColumn 資料值排序;否則為 false。 預設值是 true。

傳回

新的資料行。

適用於