Gets or sets a string that specifies the property or column from which to retrieve strings for display in the combo boxes.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
[<TypeConverterAttribute("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")>] member DisplayMember : string with get, set
The data for the values stored in a column of DataGridViewComboBoxCell objects is obtained from the DataGridView.DataSource. If this data comes from a nondefault property or column, then the property must be set to the necessary property name or column name.
If the cell values are internal values not visible to the user, then use ValueMember to map the internal cell values to user-viewable values.and
When the DataSource property is set to a string array, the property does not need to be set because each string in the array will be used as a valid display string and as a valid underlying value.
Getting or setting this property gets or sets the DisplayMember property of the object returned by the CellTemplate property. Setting this property also sets the DisplayMember property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value.
The following code example demonstrates how to use a DataGridViewComboBoxColumn to aid in data entry of the title column. is set to the property name responsible for containing the user-viewable text. In this example, the is set to the same value as ValueMember because no mapping is necessary. This example is part of a larger example available in the DataGridViewComboBoxColumn class overview topic.
Available since 2.0