MultiColumn Combo Box Problem:::

Posted by: xpletus-geek on 8 September 2017, 1:58 pm EST

  • Posted 8 September 2017, 1:58 pm EST

    Hi all,


     Can i know hw we can add values into multi column combo box on runtime


     Thanxs in Advance

  • Replied 8 September 2017, 1:58 pm EST

    Hi, 

    You may use following code to bind the MultiColumnComboBox at run time.

    string conStr = "Provider=Microsoft.JET.OLEDB.4.0;data source=C:\\SpreadWinForms4\\Common\\Patients2000.mdb";

    string sqlStr = "SELECT * FROM Patients";

    System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(conStr);

    DataSet ds = new DataSet();

    System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter(sqlStr, conn);

    da.Fill(ds);

    FarPoint.Win.Spread.CellType.MultiColumnComboBoxCellType mcb = new FarPoint.Win.Spread.CellType.MultiColumnComboBoxCellType();

    mcb.DataSourceList = ds;

    mcb.DataColumn = 2;

    mcb.ColumnEdit = 2;

    Adding, Deleting or Editing data in the DataSet(ds) will reflect in the MultiColumnComboBox. 

    Regards, 

Need extra support?

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

Learn More

Forum Channels