Defines the field, of a selected data source, which will be displayed in the control.
Remarks
Property specifies the field whose value will be displayed in the control when a record is selected. The value of this field will only represent the record in a control, but its value will not be passed to any other data source or statement.
It is possible to select only one field for the DisplayMember 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 passed further into some business logic, is determined in ValueMember property.
Example (MxSpace)
To see the defined DisplayMember property on a control (Combo) open MxSpace solution project in Visual Studio. In Solution Explorer expand node Parts and double click StockPart.cs. Click the combo control containing articles and open Property Window. See the value Name defined in DisplayMember property.
To define DisplayMember property
- In Solution Explorer open MxPart component (StockPart) which contains control (Combo) for data binding.
- Select the desired control (Combo – Article) on the canvas.
- Open Property Window.
- In section Data in DisplayMember property select the field whose value will be displayed in the control when a record is selected (Name).