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);
}

}

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s