MX-Frame Library Send comments on this topic.
Number
MX-Developer > User Interface - MxPart > Controls > Number

Glossary Item Box

Control is intended for editing numerical values. It consists of a text editor and a pair of buttons. With this buttons it is possible to set the desired value.
 
With up and down arrow buttons it is possible to increment or decrement value, displayed in the editor's text edit section. The value can be either of integer type or decimal type. The increment or decrement factor can be defined in property Increment. The factor can also be a decimal value.

Control can be used to display value of a field or to serve as a parameter provider. With the help of control's properties it is possible to edit value of a specific data source and to save changes directly to the database.

It is possible to define constraints which prevent the user from entering inappropriate values. Defining values in properties MaxValue and MinValue sets lower and upper limits.

Control is appropriate in cases where only numeric values will be displayed and entered. Using this control user is prevented from entering alpha characters or any other inappropriate characters. This avoids any further data verification before the manipulation.

Control has many properties that define its appearance, design, behaviour etc.

Context Properties

Properties in this section define the appearance of the control in Personalization Directory and the behaviour of the control when in edit mode.

Property Description
Category Define the name by which the control is displayed in Personalization Directory.
Entity Defines the name of the group in which the control is located in Personalization Directory.
NavigationVisible The feature is obsolete.
TrackDirty Defines whether user interface can be closed while the control is in edit mode.

Data Properties

Properties in this section define how and which data is bound to the control.

Property Description
Adapter Defines the MxAdapter component from which data can be retrieved and used for any kind of manipulation.
DataMember Defines the scheme field of which the value is displayed in the control.
DataSourceName Defines the data source which will be used to display and manipulate data.
Parameters Defines the input parameters for any desired statement; readable or writable.
Key Define the key by which the control is uniquely represented in the system.
Scope Defines the scope for which the value is remembered.

Design Properties

Properties in this section define basic properties of the control, appearance and functionality of the control.

Property Description
Name Defines the name of the control or the component.
DefaultValue Defines the value displayed when no other value is selected by a user.
AllowNullInput Defines whether it is possible to enter null values in the control.
Increment Defines the number by which the value is incremented or decremented.
IsFloating Defines whether the value of the control can be a decimal value.
MaxValue Defines the maximum value which can be entered in a control.
MinValue Defines the minimum value which can be entered in a control.
NullText Defines the text displayed when the control has null value assigned.

NOTE: Properties described here are related exclusively to Mx Controls. For the description of other properties please see Developer Express documentation.

Example (MxSpace)

To see the implementation of Number control open MxSpace solution project in Visual Studio. In Solution Explorer expand node Parts and double click StockPart.cs. See the Number control used for editing quantity.

To implement Number control

  1. In Solution Explorer open the desired MxPart component (StockPart) and add Number control from the Toolbox on the canvas to a desired location.
  2. Select the control and open Property Window.
  3. In Adapter property select the desired adapter.
  4. In DataSourceName property select the data source containing the field whose value will be displayed.
  5. In DataMember property select the field whose value will be displayed.
  6. In Parameters property define the parameter and the statement to which the value is passed.
©2009 Metronik. All Rights Reserved.