DataGridColumnStyle.EnterNullValue 方法


向列中输入 ValueEnters a Value into the column.

protected public:
 virtual void EnterNullValue();
protected internal virtual void EnterNullValue ();
abstract member EnterNullValue : unit -> unit
override this.EnterNullValue : unit -> unit
Protected Friend Overridable Sub EnterNullValue ()


下面的代码示例演示如何重写 EnterNullValue 方法。The following code example shows a possible override of the EnterNullValue method.

Overrides Protected Sub EnterNullValue()
   ' Enter the NullText value into a hosted TextBox control.
   Me.TextBox.Text = Me.NullText
End Sub


当用户按 ALT + 0 以允许列输入相应的 null 值时,将调用此方法。This method is called when the user presses ALT+0 to allow a column to enter the appropriate null value. 例如,在上调用时 DataGridTextBoxColumn ,相应的 NullText 值将插入到列中。For example, when called on a DataGridTextBoxColumn, the appropriate NullText value is inserted into the column.

EnterNullValue没有默认行为。The EnterNullValue has no default behavior. 从继承时 DataGridColumnStyle ,重写方法以 null 在列中输入。When inheriting from DataGridColumnStyle, override the method to enter null in a column.