Home Forums WinForms controls Xceed Grid for WinForms Combobox display problem

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

    Hi,

    I have this problem while displaying a combo in a grid cell.If I click on that particular cell I can see the entries in the combobox but as soon as I move the focus out of the cell, the combo turns blank eventhough I have a value selected.This is my code in the app startup.

    Xceed.Grid.Editors.GridComboBox gc = new Xceed.Grid.Editors.GridComboBox();
    gridControl1.Columns[“GDHACCOUNT”].CellViewer =
    new Xceed.Grid.Editors.ControlViewer(gc,”SelectedValue”);

    gridControl1.Columns[“GDHACCOUNT”].CellEditor =
    new Xceed.Grid.Editors.CustomEditor(gc,”Text”,true);

    I saw this link http://www.xceedsoft.com/Forums/ShowPost.aspx?PostID=2675 which explains a similar issue but it did not help.I dont use any datasets anywhere and am not using detailgrids.

    Thanks,
    Sekhar

    Imported from legacy forums. Posted by mail2sekh (had 4388 views)

    User (Old forums)
    Member
    Post count: 23064

    I don’t think you need to wrap the GridComboBox in a ControlViewer or CustomEditor: GridComboBox is already designed to be used as CellViewer or CellEditor. Try this:<code>gridControl1.Columns[“GDHACCOUNT”].CellViewer = gc;
    gridControl1.Columns[“GDHACCOUNT”].CellEditor = gc;</code>

    Imported from legacy forums. Posted by Tommy (had 186 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Tommy,
    I tried that.But the combobox becomes visible only if I click on that cell in the grid.As soon as that cell loses focus it appears like a normal edit box.The dropdown arrow button of the combobox and the dropdown list reappears once I click on that cell again.The difference in this case from the previous one is that the selected text is visible.

    Thanks,
    Sekhar.

    Imported from legacy forums. Posted by mail2sekh (had 291 views)

    User (Old forums)
    Member
    Post count: 23064

    If you use a combobox as CellViewer, it will only display the selected text, and not the entire control. I think it’s a lot cleaner this way. Do you really want to display the entire control (with borders and button) for each cell of that column?

    Imported from legacy forums. Posted by Tommy (had 276 views)

    User (Old forums)
    Member
    Post count: 23064

    Well,In my particular case I have just one cell being used as a combo in just the top row.So users dont know which cell is the combo unless they see the combo even when it is not selected.So I want just that cell to remain as a combo throughout irrespective of it’s selection.Is that complicated ?

    Imported from legacy forums. Posted by mail2sekh (had 326 views)

    User (Old forums)
    Member
    Post count: 23064

    OK, then it’s probably better to use a ControlViewer, like you originally did. But instead of <i>”SelectedValue”</i>, try <i>”SelectedItem”</i>.

    Imported from legacy forums. Posted by Tommy (had 194 views)

    User (Old forums)
    Member
    Post count: 23064

    I had tried all possible permutations of that with no luck.It’s always either you get to see the combo or you get to see the text but not both.Seems to follow Heisenberg’s principle !

    Imported from legacy forums. Posted by mail2sekh (had 5544 views)

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