Hi Richard,
Thank you for your reply.
The scenario is this. The management decided to change the design of the current application. We found out that some of the designs they wanted can be done using Telerik controls. We changed the old 3rd party controls with Telerik. (In most cases, we changed it in the InitializedComponent() procedure). The buttons are then set to linear gradient style.
These buttons are in custom user controls (most of the user controls contains a complete screen for user interaction) where in depending on user actions, the custom user controls are shown or hidden (or loaded or unloaded).
When showing (loading etc) the custom user control, the gradient style just changed to solid even if there's no code to change it. (I tracked it first using the RadControlSpyForm and then using the snippet I posted earlier. The changing also happened when I load a new form (show dialog) and/or when I just disable enable a button (e.g. repeat button).
I search the entire solution of ".GradientStyle = GradientStyles.Solid" to make sure there's no code that programmatically change it to solid. I only found 2 in
private void dataGrid_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (bfValue >= bfRed) {
e.CellElement.DrawFill = true;
e.CellElement.GradientStyle = GradientStyles.Solid;
e.CellElement.BackColor = colourRed;
e.CellElement.BackColor2 = colourRed;
}
else if (bfValue >= bfYellow)
{
e.CellElement.DrawFill = true;
e.CellElement.GradientStyle = GradientStyles.Solid;
e.CellElement.BackColor = colourYellow;
e.CellElement.BackColor2 = colourYellow;
}
}
I commented it but still, the problem is there.
Then I search for this..."GradientStyles.Solid" and I found codes same as the sample below in the designer part.
this.keyGrid.HeaderGradientStyle = Telerik.WinControls.GradientStyles.Solid;
We are not using MDI and radDock. This happened after we updated to Q3 2010 and when I tried to changed some element properties of the one of the buttons. I already reverted the changes but still, the problem is there.
I hope I explained it clearly. The change property event of the gradient style fire each time I show/hide/load/unload a form or a custom user control even without explicitly changing it.
Thank you very much,
Ian