Home Forums WinForms controls Xceed Grid for WinForms ComboBoxViewer || WinComboBox

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

    Please HELP !!

    I have a grid with data from a DataSource..
    For example a DataTable with 3 columns : “id” , “street” and “city”, and I want the “city” to be chosen from a ComboBox …. “city” column type is int , and using a ComboBoxViewer ,
    I can display in the Cell the name of the city , not the id. The CellManagerEditor for the “city”
    column is a ComboBoxEditorManager. The data is taken from a data source ( “id” and “city” )

    The problem is that I want to put an item in the combobox ( “New” for ex. ) tho make a new city. I want to know if I can raise an event for this combo box and test SelectedIndex,or something like this.

    Or I can catch an event when the text of the cell is changed, but I need this before the Cell ends edit, and I did’t find an event like this.

    Please give me a solution how I can resolve my problem.

    Imported from legacy forums. Posted by gigi_gigi (had 2036 views)

    User (Old forums)
    Member
    Post count: 23064

    “raise an event for this combo box and test SelectedIndex”

    Hi,
    would the following code work for you?

    WinComboBox combo = new WinComboBox();
    combo.SelectedIndexChanged += new EventHandler
    (combo_SelectedIndexChanged);
    myColumn.CellEditorManager = new Xceed.Grid.Editors.ComboBoxEditor(combo);

    Within the event handler combo_SelectedIndexChanged, you can test for the SelectedIndex and do what you want in case the “New” entry has been selected.

    Regards, Mario

    Imported from legacy forums. Posted by mario.muja (had 3087 views)

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