Gets or sets the data source whose data contains the possible selections shown in the drop-down list.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Typically this property will be set for an entire column of cells through the DataGridViewComboBoxColumn.DataSource property.
If possible, set DisplayMember property doesn't need to be set. But if the source is more complicated, set DisplayMember to the name of the property or column from which to retrieve possible selections.to a source containing only the possible selections, like a column of selections. Then the
Changing the Items collection and redraw itself.property causes the cell to reinitialize its
When you change the value of the ValueMember and DisplayMember property values with the new data source, and sets each property to null if its value cannot be found. Any exception that occurs during this process is ignored unless it is one of the following critical exceptions: NullReferenceException, StackOverflowException, OutOfMemoryException, ThreadAbortException, ExecutionEngineException, IndexOutOfRangeException, or AccessViolationException.property, the control attempts to use the
When the DataGridViewComboBoxCell attaches to the Disposed event of the data source. When the DataGridViewComboBoxCell is detached from the DataGridView, the resource is not immediately released. The DataGridViewComboBoxCell resource is released when the attached data source is disposed. To release the resource for garbage collection immediately, set the property to null.is set, the
The following code example demonstrates the use of the DataGridViewComboBoxColumn.DataSource property, which is similar to this property. This example is part of a larger example available in the DataGridViewComboBoxColumn class overview topic.
Available since 2.0