語言

DynamicField.DataFormatString 屬性

定義

取得或設定指定資料欄位值顯示格式的字串。

public:
 property System::String ^ DataFormatString { System::String ^ get(); void set(System::String ^ value); };
public string DataFormatString { get; set; }
member this.DataFormatString : string with get, set
Public Property DataFormatString As String

屬性值

一個格式化字串,用來指定資料欄位值的顯示格式。 預設為空字串(“”),表示該值未套用特殊格式。

備註

使用該 DataFormatString 屬性來指定物件中顯示 DynamicField 值的自訂顯示格式。 如果屬性未設定, DataFormatString 欄位值會顯示,且不會有特殊格式。

預設情況下,格式字串僅在包含 DynamicField 該物件的資料綁定控制項處於唯讀模式時,才套用到欄位值。 在編輯模式下,若要將格式字串套用到欄位值,請將屬性設 ApplyFormatInEditMode 為 true。

你用該 DataFormatString 屬性指定的顯示格式是針對這個類別實例 DynamicField 特有的。 你也可以透過將 套 DisplayFormatAttribute 用到資料模型中,並在建構子中設定 DisplayFormatAttribute.DataFormatString 命名參數,來改變整個應用程式資料欄位的顯示格式。 欲了解更多資訊,請參閱 動態資料 ASP.NET。

適用於

另請參閱