In the WinGrid sample explorer for Infragistics 7.1 version, a sample named "Flood Fill" (located in "Extensibility Samples")demonstrate how progress bar can be included in cells.
I have studied the source code and seen that this functionality in not a built-in one, but uses the DrawElement method to paint a rectangle in each cell. I have also remarked that for long bounded tables (ie with a lot of rows), rectangles take some time to draw (we can see each rectangle to be drawn).
I would like to know if this functionality is now included in the component or if it will be in the futur. If not, are there some possible code optimisations to do to increase draw performance?
Thanks in advance.
Rico
Hi Rico,
That sample is pretty old and there is a new, better way.
You can now use the UltraProgressBar control for this. Just put one on the form with the grid and assign the column's EditorControl property to the ProgressBar. You will probably want to set the MinValue and MaxValue on the grid column, as well, to give the progress bar the correct range of values.
Thanks Mike,
You're right, the method you give here is much more simple than drawing a rectangle for each cell in the DrawElement event handler ; and it does not hurt display performances, so it is the solution I adopted.
For others that have the same needs, here is a sample code on how to achieve my goal on the 'colName' column:
Dim col As Infragistics.Win.UltraWinGrid.UltraGridColumn
col = Me.UltraGrid1.DisplayLayout.Bands(0).Columns(colName)
' Set column min & max values
Dim dv As New Data.DataView(Me.UltraGrid1TableDatasource) dv.Sort = colName + " DESC"
col.MinValue = dv(dv.Count - 1)(colName) col.MaxValue = dv(0)(colName) Dim upb As New Infragistics.Win.UltraWinProgressBar.UltraProgressBar upb.Visible = False upb.UseFlatMode = Infragistics.Win.DefaultableBoolean.True
' Set SupportThemes to false to allow Continuous progress bar Me.UltraGrid1.UseOsThemes = Infragistics.Win.DefaultableBoolean.False
upb.Style = Infragistics.Win.UltraWinProgressBar.ProgressBarStyle.Continuous Me.Controls.Add(upb) col.EditorControl = upb col.CellAppearance.TextHAlign = Infragistics.Win.HAlign.Center
Thanks again for your answer.