Partilhar via


DataGridBoolColumn.EnterNullValue Método

Definição

Insere um Value na coluna.

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

Exceções

A propriedade AllowNull está definida como false.

Exemplos

O exemplo de código a seguir usa o EnterNullValue para inserir um valor nulo na coluna .

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

Comentários

Para definir o valor real usado ao inserir um valor nulo, use a NullValue propriedade .

Aplica-se a

Confira também