Home Forums WinForms controls Xceed Grid for WinForms Combobox confusion Reply To: Combobox confusion

User (Old forums)
Member
Post count: 23064

If the column is a string, you only need to set the CellEditorManager, but when it is a numeric one, you need to also set the CellViewerManager.

e.g.:

WinComboBox box = new WinComboBox(northwindDataSet, “Suppliers”, “SupplierID”, “%CompanyName%” );

ComboBoxEditor cboEditor = new ComboBoxEditor( box );

ComboBoxViewer cboViewer = new ComboBoxViewer( box );

gridControl1.Columns[

“SupplierID” ].CellEditorManager = cboEditor;

gridControl1.Columns[

“SupplierID” ].CellViewerManager = cboViewer;

 

The DisplayFormat property is for the TextBox portion of the ComboBox.  To change the dropdown display, you need to set the visible property to false for each column you don’t want to display.

e.g.:

foreach( ColumnInfo col in cboEditor.TemplateControl.Columns )

{

    if( col.Name != “CompanyName” )

    {

        col.Visible =

false;

    }

}

Imported from legacy forums. Posted by André (had 785 views)