MX-Frame Library Send comments on this topic.
ValueMember
See Also
MX-Developer > User Interface - MxPart > Controls > Control Properties > Data > ValueMember

Glossary Item Box

Defines the field which represents the currently selected record in the control.

Remarks

Property specifies the field which, usually uniquely, represents the selected record. The value of this field can then be passed as a parameter to any adapter and any statement; readable or writable.

It is possible to select only one field for the ValueMember property. Fields can be selected from the scheme in data source defined in property DropDownDataSourceName.

It is often the case when a control must display some field but must pass the value of primary key field or some other field. The field, whose value is displayed, is determined in DisplayMember property.

Example (MxSpace)

To see the defined ValueMember property on a control (AdvancedText) open MxSpace solution project in Visual Studio. In Solution Explorer expand node Parts and double click StockPart.cs. Click the AdvancedText control and open Property Window. See the value last_name defined in ValueMember property.

To define ValueMember property

  1. In Solution Explorer open MxPart component (StockPart) which contains control (AdvancedText) for data binding.
  2. Select the desired control (AdvancedText – Last Name) on the canvas
  3. Open Property Window.
  4. In section Data in ValueMember property select the field whose value will be used as the value of the selected record (last_name).

See Also

©2009 Metronik. All Rights Reserved.