The Value property is the main property of a C1Input control and is responsible for returning and accepting a value with a specific DataType.
When the control is not in EditMode, the Text shown by the control will display its current Value (except when TextDetached property is set to True) in a properly formatted form, see Formatting Data for details.
If the control is not read-only, it automatically switches to EditMode when it receives input focus, provided that TextDetached property is set to False. Input focus refers to when the input window of the control receives focus. In edit mode, the control’s text is edited by the user while the Value remains unchanged until the editing ends. When the user attempts to leave the control, (for instance, move the input focus elsewhere), the Value property is updated with the Text entered by the user.
The process of updating the Value involves the following three main actions:
Since the Value property is typed (according to the control’s current DataType), the process starts from the action of parsing the Text string, and converting it to the correct DataType. If necessary, the entered text can be validated at this point using string-based validation techniques such as pattern matching and regular expressions, see Validating Data for details.
Once a typed value is obtained, it passes the PostValidation check, where it can be matched against a list of predefined values, maximum and minimum values and intervals, or validated programmatically in the PostValidating event. After validation, the new value is assigned to the Value property, and then the Value property is updated to the data source.
Updating the Value normally occurs when the user tries to move the input focus out of the control or makes a mouse click outside of the control. However, it can also be triggered programmatically, by calling the UpdateValueWithCurrentText method at any time.
Setting the TextDetached property to True (it is False by default) forces the control into a special mode. If TextDetached property is set to True, the link between Value and Text is disabled, changing Value does not update Text, and changing Text does not update Value even when the control loses input focus. The Text property becomes independent of the Value property. This mode is useful when you want full programmatic control over updating the Text and Value.