Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET Progressbar

Status
Not open for further replies.
Here is my code,

GridView1.Rows.Cells[j].Attributes.Add("Style", CalculateProgressBarValue(Convert.ToInt32(GridView1.Rows.Cells[j].Text), GridView1.Rows.Cells[j].Height.Value));

private String CalculateProgressBarValue(int verimlilik, double heightt)
{
String backGroundCss = null;
int margin = 0;
if (verimlilik < 109)
margin = -250 + Convert.ToInt16(verimlilik * (2.27)) - 5;
else
margin = 0;

if (verimlilik > Convert.ToInt16(75))
backGroundCss = "background: url(../Resources/green.png) no-repeat 0px center;background-position:" + margin.ToString() + "px 2px; ";
else if (verimlilik < Convert.ToInt16(50))
backGroundCss = "background: url(../Resources/red.png) no-repeat 0px center;background-position:" + margin.ToString() + "px 2px; ";
else
backGroundCss = "background: url(../Resources/gray.png) no-repeat 0px center;background-position:" + margin.ToString() + "px 2px; ";

return backGroundCss;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top