The problem is that with the documentation example the progressbar gets drawn at wrong postitions (especially when scrolling the grid vertically) in the correct column, the original value gets drawn also (instead of the progressbar) and last but not least, the progressbar gets drawer gray instead of green (randomly).
The working code is :
//Don't do anything if there is no column info, or the cel is a Header element of the data column.
if ((e.CellElement.ColumnInfo is GridViewDataColumn) && (e.CellElement.RowElement is GridTableHeaderRowElement) == false)
{
GridViewDataColumn columnInfo = (GridViewDataColumn)e.CellElement.ColumnInfo;
if (columnInfo.FieldName == "SurfaceConsumedTotalInPct") //For all the cells that match the databound property's name.
{
e.CellElement.Children.Clear();
RadProgressBarElement progressBar = new RadProgressBarElement();
e.CellElement.Children.Add(progressBar);
double intValue = (double)e.CellElement.RowInfo.Cells["columnSurfaceConsumedTotalInPct"].Value;
progressBar.Value1 = (
int)Math.Round(intValue, 0);
if (intValue > 0)
{
//only show the % textually in the progressbar if there is a value greater than zero,
progressBar.Text = intValue.ToString() +
"%";
}
else
{
progressBar.Text =
string.Empty;
}
// apply theme to the progress bar
progressBar.SeparatorWidth = 0;
//ApplyThemeToElement(progressBar, this.radGridViewWarehouseOccupations.ThemeName);
ApplyThemeToElement(progressBar,
null);
}
}