C1FlexGrid: combobox editor backcolor

Posted by: wknauf on 23 May 2019, 7:53 am EST

    • Post Options:
    • Link

    Posted 23 May 2019, 7:53 am EST - Updated 4 October 2022, 1:12 am EST

    Hi C1,

    in our app, we use a C1FlexGrid with combo list. It seems something has changed beetween .320 and .363: when the cell has a back color, the combobox dropdown also has the BackColor of the cell.

    Is there any chance to switch off the colors in the dropdown and keep it white?

    Attached is a sample which shows this behaviour. Select a value in a cell, click some other cell and open the combobox dropdown in the now colorful cell:

    I also tried to switch the “DrawMode” of the underlying “GridEditorComboBox” from “DrawMode.OwnerDrawVariable” to “DrawMode.Normal”, but it seems C1FlexGrid ignores/overwrites this setting. And in our real app, I can switch it to “Normal”, but then the item heights decrease and the dropdown looks worse.

    In my sample, the old version .320 behaves the same way as the current version, but astonishingly, in our “real” app, the combobox dropdown is all white. I don’t know why…

    FlexEditorBackColor.zip

  • Posted 23 May 2019, 9:38 am EST

    Update: I found that in our DEV branch, it works fine. The main difference is that there I applied the workaround suggested in https://supportone.componentone.com/home/casedetail/369579 (setting “VisualStyle” resets some grid styles) - so this workaround seems to also fix the combobox color issue…

    You can ignore this thread if you want to ;-). Maybe the question is relevant for other users, but for me it is solved.

    Best regards

    Wolfgang

  • Posted 24 May 2019, 7:11 am EST

    Hello,

    I have not observed any difference in both the build. In both case, when the cell has a back color, the combo box dropdown also has the BackColor of the cell.

    You can also use the following lines of code in “SetupEditor” event to avoid this:

    
                       dynamic ts = c1FlexGrid1.Controls[0];
                        ts.GetType().GetProperty("BackColor").SetValue(ts, Color.White);
                        ((ComboBox)this.c1FlexGrid1.Editor).DrawMode = DrawMode.Normal;
    
    

    Thanks.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels