Conditional Formatting using UltraWebGrid

A code example of how to apply conditional formatting to cells in an Infragistics UltraWebGrid control using ASP.NET 2.0

private void populateSolvents(){
SolventsCollection solvents = new SolventsCollection();
solvents.GetMulti(null);

if
(solvents.Count > 0){
 

uwg_Solvents.DataSource = solvents;
uwg_Solvents.DataBind();

foreach (Infragistics.WebUI.UltraWebGrid.UltraGridRow row in uwg_Solvents.Rows.All)
{
if (row.Cells[1].Value.ToString() == "h2o")
{

 

 

row.Cells[1].Style.BackColor = System.Drawing.ColorTranslator.FromHtml("red");

}
}


} else

{ globalHelper.DoAlert("No Results to display", Page);
}

}

 

Leave a comment