Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
305
UltraControlContainerEditor Appearance
posted

Hi

I'm using UltraControlContainerEditor with UltraTextEditors for rendering and editing

with custom font color if value is > 0 or 0<.

This is what I do

            ApplyOwnerAppearanceToRenderingControl = true;
            ApplyOwnerAppearanceToEditingControl = false;
            RenderingControl = new UltraTextEditor();
            EditingControl = new UltraTextEditor();

and having problems with cell appearance for those columns with UltraControlContainerEditor.

I've simplify usage of RenderingControlso you can see where the problem is in my real code I've got some custom controls for rendering but I can reproduce this problem with simple UltraTextEditors.

Please have a look at attached pictures. Appearance on columns with  UltraControlContainerEditor is never the same as appearance on other columns. Can you please let me know if I can make it to look the same?

I have tried doing

gridColumn.EditorComponent = new UltraTextEditor(); and appearance on this column worked as expected and had the same colors as other cells. So it looks to me that there is something different when drawing UltraControlContainerEditor.

Maybe I should not be using UltraControlContainerEditor controls and assign my custom editors to EditorComponent on the column?

picture 1 - selection mode column with 10.0000 is yellow should be same as other columns

picture 2 - yellow rows - expect Quantity column to have the same background.

This is how I set colors (temp code just for this example)

In InitializeRow I check if row is a dataRow and have Processing flag set to true

if yes then:

 e.Row.Appearance.BackGradientStyle = GradientStyle.Vertical;
 e.Row.Appearance.BackColor = Color.FromArgb(253, 244, 165);
 e.Row.Appearance.BackColor2 = Color.FromArgb(220, 207, 41);

 e.Row.CellAppearance.BackGradientStyle = GradientStyle.Vertical;
 e.Row.CellAppearance.BackColor = Color.FromArgb(253, 244, 165);
 e.Row.CellAppearance.BackColor2 = Color.FromArgb(220, 207, 41);

  • 469350
    Offline posted

    Hi,

    It's hard to say for sure... I'm not sure where that yellow color is coming from in the first image you have here.

    But for the second image, it's pretty clear what's happening.

    When you embed a control in the grid using the UltraControlContainerEditor, the grid doesn't know what kind of control you are using. The control itself is opaque to the grid. So in this case, the rows in the grid are displaying using a gradient. The UltraTextEditor happens to support gradients via it's Appearance properties, but the grid and the UltraControlContainerEditor do not know this. All the UltraControlContainerEditor can do is set simple properties on the embedded control like BackColor and ForeColor. It cannot apply the same gradient, since the vast majority of control do not support gradients.