Hello: I'm currently working with an unbound datagridview and when the form loads, I populate the DataGridViewTextBoxColumns using code similar to this:
I need to set the selected index and I'm not sure how to do this. I don't see a selectedIndex property for this control.
Any help is truly appreciated.
annarene
I need to set the selected index and I'm not sure how to do this. I don't see a selectedIndex property for this control.
Code:
Sub PopulateSpeed(ByVal iColIndex)
Dim myDB As New OleDb.OleDbConnection(sConnectionString)
Dim myDA As New OleDb.OleDbDataAdapter("Select Speed from tblSpeed order by Speed", myDB)
Dim myDS As New Data.DataSet
Dim cbn As DataGridViewComboBoxColumn = dgProfiles.Columns(iColIndex)
myDA.Fill(myDS, "tblSpeed")
With cbn
.DataSource = myDS.Tables("tblSpeed")
.DisplayMember = "Speed"
.ValueMember = "Speed"
End With
myDB.Close()
End Sub
Any help is truly appreciated.
annarene