Contents
DateTimePicker.IsNull Property |
|
Gets a System.Boolean value indicating whether the user has selected nothing.
This property returns TRUE only if AllowNullValue is TRUE and the user has not selected any Year/Month/Day/etc values.
Use IsNull to decide whether the user has not entered a datetime, as opposed to entering an erroneous datetime.
| Example User Input | State of Control after Postback | Example Application |
|---|---|---|
| Reminder Date : , | IsNull would return TRUE, and HasValue would return FALSE. | The user does not want a reminder. Update the datetime reminder column for this record as NULL in the database. |
| Reminder Date : , | IsNull would return FALSE and HasValue would return FALSE. | The user does want a reminder but hasn't specified a valid value ( HasValue = FALSE ). Display a validation message and ask the user to enter a valid date, or none at all. |
| Reminder Date : , | IsNull would return FALSE and HasValue would return TRUE. | The user does want a reminder and has specified a valid value. Update the database, set IsEditable to FALSE and display the web form in a confirmation mode. |
[Visual Basic] Overridable Public Readonly Property IsNull As Boolean
[C#]
public virtual bool IsNull {get;}
[C++] public: __property virtual bool get_IsNull();
[JScript] public function get IsNull() : bool;
DateTimePicker Contents | DateTimePicker Overview | DateTimePicker Members
Support | Feedback | Contact Dune5 | Website
© 2001-2003 Dune5. All Rights Reserved.