Hello all.
I want to have in my UltraWinGrid an UltraProgressBar.
I searched this forum and I've tried everything you said in previous threads (ex : http://news.infragistics.com/forums/p/11841/44805.aspx#44805 ) but it doesn't work for me.
I've tried 2 aproaches:
1) added an UltraProgressBar next to the grid, set it's Maximum to 100 and Minimum to 0, even the Value to 50. The ProgressBar looks ok. Then in code I'm adding a new column to the grid
e.Layout.Bands[0].Columns.Add("Level", "Level");
and set it's EditorControl property to that progress bar
e.Layout.Bands[0].Columns["Level"].EditorControl = ultraProgressBar1;
I even set the column's MinValue and MaxValue to 0 and 100.
When I run my application, my new column "Level" is always showing 0%.
2) then I tried to create a UltraProgressBar in the code, set's its Maximum, Minimum and Value to the exact values as above, set it as the EditorControl of the "Level" column but the same result.
What am I doing wrong and what do I need to set so that the ProgressBar shows me what I need ?
Note : my UltraWinGrid is in CardView mode, and I want the ProgressBar to be Vertical oriented.
Thank you.
Hi,
The Value of the progress bar will be determined by the value of the cell, not the control on the form. Using the control's value would make no sense, since it can only have a single value and that would be useless in a grid.
You need to set the DataType on the unbound column to something the progress bar can accept (Int32) and assign actual values (presumably between 0 and 100) to the cells in the grid. For an unbound column, the InitializeRow event is a good place to do this.
Got it. Set the column's DataType to typeOf(Int32) and in the InitializeRow event of the grid I'm setting the cells' values to 50 (for the moment) and it works.
But I still have a problem. Allthough I'm setting the ProgressBar's Orientation property to Vertical, in the grid is still shown Horizontal. Is there any way I can fix this ?
Here is my code in the InitializeLayout event of the grid
e.Layout.Bands[0].CardView = true;
e.Layout.Bands[0].CardSettings.CaptionField = "EquipmentName";
UltraProgressBar tankPB = new UltraProgressBar();
tankPB.Orientation = Orientation.Vertical;
tankPB.Minimum = 0;
tankPB.Maximum = 100;
e.Layout.Bands[0].Columns["Level"].Editor = null;
e.Layout.Bands[0].Columns["Level"].EditorControl = tankPB;
e.Layout.Bands[0].Columns["Level"].DataType = typeof(Int32);