Home Forums WinForms controls Xceed Grid for WinForms How to add combobox to cells?

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

    I have some cells that display enumeration values. If these are editable, I would like the user to select a new value from a list/combobox in that cell. How do I do this?

    -dh

    Imported from legacy forums. Posted by dahoffer (had 3027 views)

    Xceed Support
    Member
    Post count: 5658

    Hi dh,

    You can set the column’s (if all the cells in the column will have the same editor) or a cell’s CellEditor property to a <a href=”http://doc.xceedsoft.com/products/gridNet/ref/xceed.grid.editors.gridcombobox.html”>GridComboBox</a&gt;.

    For more information, please refer to the <a href=”http://doc.xceedsoft.com/products/gridNet/doc/sources/celleditors_and_viewers.htm”>Cell editors and viewers</a> topic in the help file.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 435 views)

    User (Old forums)
    Member
    Post count: 23064

    Jenny,

    Thanks, this works. However because these are enumeration values, I guess I have a special need.

    Currently the cells show a string representation of the enum constant, such as A_2. However, I would like to display something a little different in the cells (both the grid and the gridcombobox), such as “A 2º”. How can I display these more user frendly text strings to the user, but these always refer to the corresponding enumeration value in the code?

    -dh

    Imported from legacy forums. Posted by dahoffer (had 364 views)

    Xceed Support
    Member
    Post count: 5658

    Hi dh,

    If you have both values in a data table, you can use the ValueMember and Display member properties of the GridComboBox (which derives from ComboBox) to display the “readable” value.

    I hope this helps!

    Imported from legacy forums. Posted by Jenny [Xceed] (had 3957 views)

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