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

    Hi,

    I have a column of which the value/content of the cell is selected from a comboBox.I wrote the following:

    WinComboBox winComboBox = new WinComboBox();

    winComboBox.Items.Add(new ComboBoxItem(new object[1] {“Item 1”}));

    winComboBox.Items.Add(new ComboBoxItem(new object[1] {“Item 2”}));

    DataRow.Cells[0].CellEditorManager = new ComboBoxEditor(winComboBox);

    DataRow.Cells[0].CellViewerManater = new ComboBoxViewer(winComboBox);

    However, it doesn’t appear as what I want as in the Sample (Solid Foundation). For example, I want to have the combo box arrow appears only if the cell is selected. And I want the cell to be non-editable by user except user can select the value from the combo box. My code doesn’t do what I want currently. My grid doesn’t bind to a data set as in the Sample. (It is an unbound data grid.) Can I have some suggestion of what I should do? Thanks a lot!!

    Imported from legacy forums. Posted by Sop (had 599 views)

    User (Old forums)
    Member
    Post count: 23064

    First, don’t set the viewer :

        //DataRow.Cells[0].CellViewerManager = new ComboBoxViewer(winComboBox);

    The ComboBox will appear only when editing the cell.

    Second, do the following to control what the user can do with the ComboBox :

        winComboBox.TextBoxArea.ReadOnly = true;

        winComboBox.AllowFreeText = false;

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

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