0

How to get selected DataGridViewComboBoxColumn values in vb.net?

Sergey K.
  • 24,894
  • 13
  • 106
  • 174
Asad Chohan
  • 29
  • 3
  • 4

1 Answers1

2

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

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Jagmag
  • 10,283
  • 1
  • 34
  • 58