ComboBoxCellType - Click the ComboBox, Current Value Disappears

Posted by: b2mje112 on 8 September 2017, 1:29 pm EST

  • Posted 8 September 2017, 1:29 pm EST

            Dim ctComboBoxColumn As New FarPoint.Win.Spread.CellType.ComboBoxCellType
            Dim strDesc() As String = {"Correction", "Correct as Submitted", "Delete"}
            Dim strData() As String = {1, 2, 3}
            ctComboBoxColumn.Items = strDesc
            ctComboBoxColumn.ItemData = strData
            ctComboBoxColumn.Editable = False
            ctComboBoxColumn.AutoSearch = FarPoint.Win.AutoSearch.None
            ctComboBoxColumn.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.Index

     

    I then set the celltype of various columns to this celltype.  I set the value of certain cells to 1 - (Correction).

    I run the app and "Correction" is the selected item, but when I click the combo box the current selection disappears and nothing is in the combo box.  Any clues?

  • Replied 8 September 2017, 1:29 pm EST

    Nevermind ...

    I was setting the editorvalue to ItemData underneath this (and I didn't see it until now).    Problem solved.

  • Replied 8 September 2017, 1:29 pm EST

    What version are you using?  I tested your code and when I click the combobox the list drops down showing the data...

    Dim ctComboBoxColumn As New FarPoint.Win.Spread.CellType.ComboBoxCellType
    Dim strDesc() As String = {"Correction", "Correct as Submitted", "Delete"}
    Dim strData() As String = {1, 2, 3}
    ctComboBoxColumn.Items = strDesc
    ctComboBoxColumn.ItemData = strData
    ctComboBoxColumn.Editable = False
    ctComboBoxColumn.AutoSearch = FarPoint.Win.AutoSearch.None
    ctComboBoxColumn.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.Index

    FpSpread1.ActiveSheet.Columns(0).CellType = ctComboBoxColumn
    FpSpread1.ActiveSheet.Cells(0, 0).Value = 0

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels