Setting Selected Index in a DataGridViewComboBoxColumn

  • Thread starter Thread starter john
  • Start date Start date
J

john

Hi all,

I am trying to set the selected index on a DataGridViewComboBoxColumn.
I have looked through the MS docs and cannot find how to do this.

Is it possible?

Here is my code

'first create a combobox column to show the location list
Dim comboLoc As New DataGridViewComboBoxColumn
comboLoc.Name = "Location"
comboLoc.Items.Clear()
comboLoc.DataSource = dsLocations
comboLoc.DisplayMember = "StoreNumber"
'add column to datagridview
grdShifts.Columns.Insert(1, comboLoc)

Dim drShifts As DataRow

For Each drShifts In dsShifts.Rows

*******I need to set the selected item here ???
combLoc.selectedIndex = 1


thanx,
 
Back
Top