共用方式為


DataGridBoolColumn.EnterNullValue 方法

定義

輸入 Value 至資料行。

protected public:
 override void EnterNullValue();
protected internal override void EnterNullValue ();
override this.EnterNullValue : unit -> unit
Protected Friend Overrides Sub EnterNullValue ()

例外狀況

AllowNull 屬性會設定為 false

範例

下列程式碼範例會使用 , EnterNullValue 在資料行中輸入 Null 值。

private:

   void EnterNull()
   {
      
      // Creates an instance of a class derived from DataGridBoolColumn.
      MyDataGridBoolColumn^ colBool;
      colBool = dynamic_cast<MyDataGridBoolColumn^>(dataGrid1->TableStyles[ 0 ]->GridColumnStyles[ 2 ]);
      colBool->CallEnterNullValue();
   }


internal:

   // Class derived from DataGridBoolColumn.
   ref class MyDataGridBoolColumn: public DataGridBoolColumn
   {
   public:
      void CallEnterNullValue()
      {
         this->EnterNullValue();
      }

   };
private void EnterNull() {
   // Creates an instance of a class derived from DataGridBoolColumn.
   MyDataGridBoolColumn colBool;
   colBool = (MyDataGridBoolColumn)dataGrid1.TableStyles[0].GridColumnStyles[2];
   colBool.CallEnterNullValue();
}

// Class derived from DataGridBoolColumn.
internal class MyDataGridBoolColumn : DataGridBoolColumn {

   public void CallEnterNullValue() {
      this.EnterNullValue();
   }
}
Private Sub EnterNull()
   ' Creates an instance of a class derived from DataGridBoolColumn.
   Dim colBool As MyDataGridBoolColumn
   colBool = CType(dataGrid1.TableStyles(0).GridColumnStyles(2), MyDataGridBoolColumn)
   colBool.CallEnterNullValue()
End Sub    
    
 ' Class derived from DataGridBoolColumn.
Friend Class MyDataGridBoolColumn
   Inherits DataGridBoolColumn        
        
   Public Sub CallEnterNullValue()
      Me.EnterNullValue()
   End Sub
End Class

備註

若要設定輸入 Null 值時所使用的實際值,請使用 NullValue 屬性。

適用於

另請參閱