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

    <SPAN id=result_box class=long_text><SPAN style="BACKGROUND-COLOR:#fff;">I'm trying to use the combobox on the Winform with multi column on version 4, but I have difficulties to several things:</SPAN></SPAN><SPAN class=long_text><SPAN style="BACKGROUND-COLOR:#fff;">
    </SPAN><SPAN style="BACKGROUND-COLOR:#fff;">1. </SPAN><SPAN style="BACKGROUND-COLOR:#fff;">How to set the column width of each column.
    </SPAN><SPAN style="BACKGROUND-COLOR:#fff;">2. </SPAN><SPAN style="BACKGROUND-COLOR:#fff;">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).
    </SPAN><SPAN>3. </SPAN><SPAN style="BACKGROUND-COLOR:#fff;">How to set bind fields in each column.

    </SPAN><SPAN style="BACKGROUND-COLOR:#fff;">Thanks</SPAN></SPAN>

  • Replied 8 September 2017, 2:25 pm EST


    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)
            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.



Need extra support?

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

Learn More

Forum Channels