ComponentOne Input for ASP.NET AJAX: Input for ASP.NET AJAX Task-Based Help > C1DateInputTasks > Displaying an Empty Date Value

Displaying an Empty Date Value

When you run your project that contains a C1DateInput control, the default date, January 1, 0001 12:00:00, automatically appears inside the control, regardless of how you have customized the controls (see Setting the Date Format Pattern and Date). If you want the date to remain empty and not to show this default January 1, 0001 date, complete the following steps:

Using the Designer

1.   Place a C1DateInput control on your form and two other controls, for this example use a TextBox and a Button control. These additional controls make it possible to switch from the C1DateInput control to another control on your page.

 

2.   Switch the ShowNullText property from False to True.

3.   Enter the desired Empty Date Value in the NullText property. For this example, use {Empty Date}.

 

 

4.   Run the project and notice the {Empty Date} of the C1DateInput control.

5.   Select the C1DateInput so that the {Empty Date} is replaced with the default date.

 

 

6.   Either with the cursor or by pressing the Tab button, select one of the other controls on your form.

 

 

Notice that the {Empty Date} returns to the C1DateInput control.

Note: The empty value which you have assigned to the control will appear when you first run the project. Once you select the control and toggle through the dates, the only way to have the empty value to reappear is to select another control on your page; you cannot “delete” the date within the control, you can only make the empty value text visible.


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.