# Handling Null and Empty Values

## Content

**C1Input** provides rules for handling **NULL (DBNull)** values in data‑entry controls. The following sections describe how null and empty values are displayed and entered.

## Displaying Null and Empty Values

When a control is not in edit mode or is read‑only, null values are displayed according to the [NullText](/componentone/api/win/online-input-net/dotnet-api/C1.Win.Input.10/C1.Win.Input.C1Label.NullText.html) property, which can be overridden in **DisplayFormat**. If **EmptyAsNull** is set to **True** (default: **False**), empty strings are also displayed using the **NullText** value. In edit mode, the **NullText** and **EmptyAsNull** properties of **EditFormat** apply instead of those in **DisplayFormat**.
When edit mode is active with an **EditMask**, null values and empty strings appear as an empty mask with literals and prompt characters.
When editing a date‑time value and **DateTimeInput** is **True**, a null value appears as an empty control. When editing begins, the control assigns a non‑null value using the last assigned value or the current date.
When **FormatType** is set to **UseEvent**, the **Formatting** event is triggered only for non‑null values.

## Entering Null and Empty Values

Unless **EditMask** mode is active, null values can be entered using the following methods:

* If the control text equals **NullText**, the resulting value is **null**. Comparison behavior depends on the **CaseSensitive** property.
* Clearing the control and entering an empty string produces a null value when **C1TextBox.EmptyAsNull** is **True** (default: **False**).
* In programmatic parsing, the **Parsing** event can return **DBNull**.

When a null value is entered, input string validation and parsing are skipped. **PostValidation** is still executed.
See **Input String Validation (PreValidation)**, **Parsing (Updating) Data**, and **Typed Value Validation (PostValidation)**.