a 是后台的数字列,b是对应的值
ReDim a(0 To ds.Tables("IDA_Select_List_Attribute").Rows.Count - 1)
ReDim b(0 To ds.Tables("IDA_Select_List_Attribute").Rows.Count - 1)
a = cl_common.fc_dt_column_tostring(ds.Tables("IDA_Select_List_Attribute"), "存储值")
b = cl_common.fc_dt_column_tostring(ds.Tables("IDA_Select_List_Attribute"), "显示值")
If dr_temp.Count = 0 Then '如果当前值不在下拉菜单,必须先加进去,否则看不到
ReDim Preserve a(0 To a.Length)
ReDim Preserve b(0 To b.Length)
a(a.Length - 1) = current_value
b(b.Length - 1) = current_value
End If
cmbocell.ItemData = a
cmbocell.Items = b '显示的值
cmbocell.AutoSearch = FarPoint.Win.AutoSearch.MultipleCharacter
cmbocell.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData
cmbocell.AutoCompleteMode = AutoCompleteMode.SuggestAppend
cmbocell.AutoCompleteSource = AutoCompleteSource.ListItems
cmbocell.DropDownOptions = DropDownOptions.Button
cmbocell.AcceptsArrowKeys = True
cmbocell.MaxDrop = 8
cmbocell.DoubleClickTextToDropDown = True
FpSpread1.ActiveSheet.Cells(address.Replace("$", "")).CellType = cmbocell |