How to get selected DataGridViewComboBoxColumn values in vb.net?
1 回答
The first link in my google search :-)
How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List
There is a complete example on this MSDN page.
Specifically note the following regarding getting the selected values
Unlike the ComboBox control, the DataGridView types do not have a SelectedItem propertyfor retrieving the currently selected object. Instead, you must set the System.Windows.Forms.DataGridViewComboBoxColumn.ValueMember or System.Windows.Forms.DataGridViewComboBoxCell.ValueMember property to the name of a property on your business object. When the user makes a selection, the indicated property of the business object sets the cell Value property.
Click on "VB" in the code boxes to see the appropriate VB.net code syntax