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
You do not need to use more than one UltraProgressBar control here. You can use a single progress bar for an unlimited number of cells in the grid and each cell in the grid will display a progress bar with the value appropriate to that cell.
If you are getting the same value in every cell of the grid, then either every cell in the grid has the same value or something is very wrong here.
The progress bar uses the value of the cell itself, so if you change the value of a cell, the value of its progress bar will change too, and it won't effect any other cell. If you want to get a reference to the progress bar you can use cell.EditorControlResolved.
If you need different things for each cell and what mike said is not enough, you can create a progress bar for each cell. Use InitializeRow event, each time create a new progress bar by code and use it as e.Row.Cells[indexOrName].EditorControl.