Hi All,
I'm using WinProgressBar as column editor to show the progress for particular row. It looks like the followin:
| action_1_name | action_1_progress |
| action_2_name | action_2_progress |
...
| action_N_name | action_N_progress |
The general question is: how can I modify the progress bar properties for particular row? For example - I need that while action in progress the progress bar color will be let say red, but once the action complete for particular row - the progress bar become greeen for this row. Is it possible?
thx
Update: I decided to play with progress bar colors but it doesn't work for me at all. I tried to set the progress bar collor in InitializeLayout like this:
private void Grid_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { progressBar.UseOsThemes = DefaultableBoolean.False; progressBar.FillAppearance.BackColor = Color.Green; e.Layout.Bands[0].Columns[1].EditorControl = progressBar; }
But the color still the same(system one?). Can any1 have any idea?
Setting UseOsThemes on the progressBar control will not have any effect on the grid because the grid has it's own UseOsThemes property. The grid only picks up properties from the editor if the grid doesn't have it's own property to deal with those settings.
So what you need to do is turn off themes on the grid. Or... you probably just want to turn off themes on the one column, which you can do using the ThemedElementAlpha.
To get different appearances of the progress bar at different values, you use the PercentSettings.
So try something like this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { this.ultraProgressBar1.FillAppearance.BackColor = Color.Red; PercentSetting percentSetting100 = this.ultraProgressBar1.PercentSettings.Add(100); percentSetting100.FillAppearance.BackColor = Color.Green; rootBand.Columns["Int32 1"].MinValue = 0; rootBand.Columns["Int32 1"].MaxValue = 100; rootBand.Columns["Int32 1"].EditorControl = this.ultraProgressBar1; rootBand.Columns["Int32 1"].CellAppearance.ThemedElementAlpha = Alpha.Transparent; }
Hello,
I still don't understand how to increment values of the cell imbedded progress bar as explained above. I assume your this.ultraProgressBar1 is a progress bar placed on the winform (and maybe hidden). So all of your rows are assigned the same progress bar.
i did the same in my grid. Result: once I change the cell value, all progress bars are getting the same value... that's what I expect I have always assigned the same progress bar control.
or is this working differently? So is ultraProgressBar1 only acting as a template (for layout purposes only)? How can I increase the values of the cell-integrated progress bar if it is not the cell value itself?
YoursStephan
Hi Mike,
Tnx a lot for quick responce! U solution works fine. The probgress bar itself don't look so fancy with Transparent as it was by default but still nice.
The next my question is: do I have any other ways to control progress bar appearance rather that PercentSettings? For example next my step is make progress bar red in case if some error ocure. How I can do it? The onlyone idea in my mind is set max value to 101 and treat 101 as error. The issue here that in this case progress bar will never be full even when 100% done. What do u think?
thanks