MX-Frame Library Send comments on this topic.
DateTime
See Also
MX-Developer > Data Access Layer - MxAdapter > Designing Data Source > Schema > Designing a Field > Editors > DateTime

Glossary Item Box

DateTime editor contains a drop down calendar. In the calendar the edited day is highlighted. The cell containing the current date has red borders. The drop down calendar contains two buttons: Today and Clear. Pressing the Today button assigns the current date to the edited value. If the Clear button is clicked, the edit value is set to the null value. An end-user can also set the edit value to null by pressing the CTRL+0 or CTRL+DEL shortcuts. Time component can be entered in a Time control.

DateTime editor can be used for editing values of DateTime data type. Using this editor it is possible to define the format in which the value is presented. It is also possible to define maximum and minimum values.

The appearance and the behaviour of the DateTime editor can be defined with its properties:

Property Description
DisplayTime If property is set to True, time part of the DateTime data type can also be selected.
FormatString Defines the format in which the text will be displayed.
NullText Defines the string that is displayed if the value of a field is missing or null.
AllowNullInput If property is set to True, null value can be entered in the editor. If property is set to True, option Clear exists in the editor which inserts null value.
MaxValue Defines the maximum value for the entered date. Maximum value is defined in the expression editor therefore the maximum value can change dynamically.
MinValue Defines the minimum value for the entered date. Minimum value is defined in the expression editor therefore the minimum value can change dynamically.

Example (MxSpace)

To see the implementation of a DateTime editor in MxSpace application click Code Lists -> Articles. Try to add new article. When entering Production Date a DateTime control appears offering to select date and input time.

To implement a DateTime editor on a field

  1. Open appropriate adapter (ArticleAdapter) in Solution Explorer.
  2. Expand the desired field (ProductionDate) in the appropriate data source schema (Articles).
  3. Click Editor node and select DateTimeEditor from a list of editors in the Available Editors section on the right.
  4. Set DisplayTime property to True.
  5. In property FormatString enter value HH:mm dd.MM.yyyy

See Also

MxAdapter
Editors

©2009 Metronik. All Rights Reserved.