Ok. I'm strugling with another problem. I'm trying to set the color of the filled percentage to a custom color. But whatever I try, it doesn't work. Found some examples on the internet, but they just won't work for me.
I've added an UltraProgressBar on the UserControl, and leave it like that.
Then in code, after the InitialiseComponents() I'm doing this
// Set the appearance of the status bar control
// to use a gradient.
ultraProgressBar2.Appearance.BackColor = Color.Gray;
ultraProgressBar2.Appearance.BackColor2 = Color.White;
ultraProgressBar2.Appearance.BackGradientStyle = GradientStyle.HorizontalBump;
ultraProgressBar2.Appearance.ForeColor = Color.Red;
// Set the appearance for the 'fill' area of the
// status bar control to use a different gradient.
ultraProgressBar2.FillAppearance.BackColor = Color.Blue;
ultraProgressBar2.FillAppearance.BackColor2 = Color.White;
ultraProgressBar2.FillAppearance.BackGradientStyle = GradientStyle.HorizontalBump;
ultraProgressBar2.FillAppearance.ForeColor = Color.Red;
// Set the border style for the control
ultraProgressBar2.BorderStyle = UIElementBorderStyle.Etched;
ultraProgressBar2.Minimum = 0;
ultraProgressBar2.Maximum = 100;
ultraProgressBar2.Value = 50;
But the filled part color is still the default one, a green color. Help please !
Okay. It sounds to me like something in your application style is overriding the FillAppearance of the ProgressBar. By default, AppStylist settings override any setting in the application. There's really no way around that, except to modify the Application Style Library you are using.
Another option would be to change the Resolution Order so that the property settings in the application take precedence over the Style Library, but that's probably not what you want, since it will apply to all controls.
Hi again !
I'm setting the column's CellAppearance.ThemedElementAlpha in the InitializeLayout event, after I add the unbound column to the grid and set it's EditorControl property, like this :
e.Layout.Bands[0].Columns.Add("Level", "Level");
e.Layout.Bands[0].Columns["Level"].Editor = null;
e.Layout.Bands[0].Columns["Level"].EditorControl = ultraProgressBar1;
e.Layout.Bands[0].Columns["Level"].DataType = typeof(Int32);
e.Layout.Bands[0].Columns["Level"].CellAppearance.ThemedElementAlpha = Alpha.Transparent;
Maybe the order is wrong ?
The ultraProgressBar1 is a UltraProgressBar that I've dropped in the UserControl, next to the grid, and doing some changes to it in the code, immediatly after the InitializeComponent() of the view's constructor. This is what I'm doing :
// Set the Minimum and Maximum
progressBar.Minimum = 0;
progressBar.Maximum = 100;
progressBar.UseOsThemes = DefaultableBoolean.False;
// Set the BackColor of the control to White.
progressBar.Appearance.BackColor = Color.White;
// Set the Default FillAppearance to Red. This will
// be applied when the Value is below all of the
// PercentSettings
progressBar.FillAppearance.BackColor = Color.Red;
// The default FillAppearance.ForeColor is System.HighlightText.
// This might not look good on a red background, depending on the
// system settings, so make it white.
progressBar.FillAppearance.ForeColor = Color.White;
So, the order in my code is : change in code the FillAppearance of the ProgressBar, then add the unbound column to the table and set it's EditorControl to that ProgressBar. If I set the UseAppStyling and UseOsThemes to false, it works, but I don't want to lose the style of the grid. Like I mentioned before, setting the .CellAppearance.ThemedElementAlpha to Transparent isn't working. HEEEEEEEEEEEEEEELP !
Setting the column's CellAppearance.ThemedElementAlpha should do it. Is the ProgressBar still displaying themed when you do this?
Can you post a sample project demonstrating what you are doing so I can take a look? I know this works, I've tested it many times, myself.
Scratch the last post, I've managed to make that ProgressBar to show the correct fill color, but now I'm not able to set the color in the ProgressBar inside the grid. As I understood, I need to set the UseAppStyling and UseOsThemes to false for that to work, and that does work, but I don't want to do that.
Then I come across this post http://forums.infragistics.com/forums/p/7120/29482.aspx#29482 that states to set the column's CellAppearance.ThemedElementAlpha to Transparent. But that doesn't do it for me. What should I do ?