Redigera

Dela via


DataGridBoolColumn.EnterNullValue Method

Definition

Enters a Value into the column.

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

Exceptions

The AllowNull property is set to false.

Examples

The following code example uses the EnterNullValue to enter a null value into the column.

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

Remarks

To set the actual value used when entering a null value, use the NullValue property.

Applies to

See also