如何設置DataGridViewComboBoxCell的SelectedIndex?DataGridViewComboBoxCell的SelectedIndex? VB.NET
代碼填充項目組合框,但我需要選擇其中之一
我的代碼:
Dim cListItems As New System.Collections.Generic.List(Of Combobox_values)
If ds.Tables("items_prices").Rows(0).Item("item_selldozen") > 0 Then
Dim item_selldozen As String = ds.Tables("items_prices").Rows(0).Item("item_selldozen")
cListItems.Add(New Combobox_values("Docena (" + item_selldozen + ")", item_selldozen))
End If
Dim dgvcbc As DataGridViewComboBoxCell = DirectCast(CType(main.ActiveMdiChild, discount_new_discount).discountitems_new_discount.Rows(last_row).Cells(3), DataGridViewComboBoxCell)
dgvcbc.DataSource = cListItems 'Fill Remote Comboboxcell
dgvcbc.DisplayMember = "Text"
dgvcbc.ValueMember = "Value"
:然後我們 創建一個臨時組合框對象並獲取所選擇的指數? – PraveenVenu 2012-03-21 17:30:44
是的,我想設置任何選定的索引 – 2012-03-21 17:41:01
我的意思是在你想要設置什麼事件或行動? – PraveenVenu 2012-03-21 17:44:35