a few questions about the multi column combobox

Posted by: arudham on 8 September 2017, 2:25 pm EST

  • Posted 8 September 2017, 2:25 pm EST

    I'm trying to use the combobox on the Winform with multi column on version 4, but I have difficulties to several things:
    1. How to set the column width of each column.
    2. How to set the format on each column to appear in accordance with the desires, such as date format (dd-mmm-yyyy) or format the numbers into (x, xx0.00).
    3. How to set bind fields in each column.

    Thanks

  • Replied 8 September 2017, 2:25 pm EST

    Hello,

    You may get the whole subeditor as Spread sheet and make your settings on this Spread sheet. For example :

     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=C:\NWIND.MDB"
            Dim sqlStr As String = "SELECT * FROM Customers"
            Dim conn As New System.Data.OleDb.OleDbConnection(conStr)
            Dim ds As DataSet = New DataSet()
            Dim da As New System.Data.OleDb.OleDbDataAdapter(sqlStr, conn)
            da.Fill(ds)
            Dim mcb As New FarPoint.Win.Spread.CellType.MultiColumnComboBoxCellType()
            mcb.DataSourceList = ds
            FpSpread1.ActiveSheet.Cells(0, 0).CellType = mcb
        End Sub
        Private Sub FpSpread1_SubEditorOpening(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.SubEditorOpeningEventArgs) Handles FpSpread1.SubEditorOpening  
            Dim combosheet As FarPoint.Win.Spread.FpSpread = CType(e.SubEditor, FarPoint.Win.Spread.FpSpread)
            combosheet.Sheets(0).Columns(0).Width = 100
            combosheet.Sheets(0).ColumnCount = 1
            combosheet.Sheets(0).Columns(0).DataField = "CustomerID"
        End Sub

    Same way you can set the celltype and apply the settings accordingly.

    I hope it will help you.

    Thanks,

     

Need extra support?

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

Learn More

Forum Channels