Home Forums WinForms controls Xceed Grid for WinForms ComboBoxEditor will not display

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14782 |

    I’ve created a grid bound to the orders table in the Northwind database, but I can’t seem to get the ShipCountry colum to display as a combobox the way it does in the examples provided. I would expect the entire orders table to display in the grid (this works) and the shipCountry to be viewed as a dropdown (this doesn’t). This doesn’t seem to be the case with the sample of code below:

    OleDbDataAdapter1.Fill(DataSet11)

    GridControl1.BeginInit() ‘ EndInit will be called later

    GridControl1.SetDataBinding(DataSet11, “Orders”)

    Dim editor As New Xceed.Grid.Editors.ComboBoxEditor
    GridControl1.Columns(“ShipCountry”).CellEditorManager = editor

    GridControl1.EndInit()

    thanks for any help

    Imported from legacy forums. Posted by max11 (had 2568 views)

    User (Old forums)
    Member
    Post count: 23064

    You need to feed the ComboBox with its own DataSource. The ShipCountry in the Order table is a string field, so the ComboBox has no data to draw from.

    For example, you could bind to the ShipCountry of the Order table :

    ComboBoxEditor editor = new ComboBoxEditor( dataSet11.Orders, “”, “ShipCountry”, “%ShipCountry%” );
    gridControl1.Columns[ “ShipCountry” ].CellEditorManager = editor;

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

    User (Old forums)
    Member
    Post count: 23064

    thanks .. that helps 🙂

    Imported from legacy forums. Posted by max11 (had 3470 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.