Home Forums WinForms controls Xceed Grid for WinForms Combobox editor in unbound mode – how to add items?

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

    Namaste!

    I am wondering how to add list items to the Items collection in an unbound comboboxeditor.

    I’d like to do it through the properties page, however, the Items & Columns Designer appears disabled when I try that.

    Is the only way to do this through code (which is fine)?

    Also, if going the code route, this particular comboboxeditor is in a 3rd-level detail grid.  To get to it, do I specify it in this way:

    datagrid.detailGrid1.detailGrid2.DetailGrid3.comboboxEditor1

    -or-

    datagrid.comboboxEditor1

    ?

    Thanks!

    Peace, Love, and Light,

    /s/ Jon C. Munson II

    Imported from legacy forums. Posted by Jon (had 1931 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi there, 

    If you try to drop a WinComboBox on a Data Grid for .NET using the Designer, the WinComboBox will actually be dropped on the form below the grid. 

    Where do you want that combobox exactly?  On a particular cell of the insertion row?  For every rows of your grid in a particular column?  On a certain row of your grid?  You can do all of these but, unfortunately, you can’t really put a combobox on a grid like you can put one on a form.  There are many ways to implement a comboxbox on a grid.  The best one is the one that is the most intuitive and practical for your scenario.  And, yes, you will have to do this by writing code.

    You should check the RichCellEditor project normally located in this folder:

    C:\Xceed Component Samples\Xceed Grid for .NET 3.8\Samples\CSharp\RichCellEditor

    In particular, the method CreateComboBoxes() from RichCellEditors.cs should give a you a good idea, although this example is for a bound combobox.  It should still give you a good starting point. 

    To add multiple items to a combobox, you can use the combobox.Items.AddRange(ICollection valuesCollection) method. 

    Light to you, too! 

    Imported from legacy forums. Posted by Ghislain (had 1258 views)

    User (Old forums)
    Member
    Post count: 23064

    Hmmm…

    Maybe I didn’t explain properly…

    I didn’t drop a combobox on the grid.  What I did is change the CellEditorManager for a particular column to a comboboxeditor.  So, now, I have a comboboxEditor1.

    The question is, how do I add items to its list?  Selecting the columns/items collection and getting the resulting designer seems to not function.  The items I want to add are not in a table of any kind – I’ll supply them.

    Unless I misunderstand what a “comboboxeditor” is…

    Thanks!

    Peace, Love, and Light,

    /s/ Jon C. Munson II

    Imported from legacy forums. Posted by Jon (had 2086 views)

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