请教DataGrid超标数据,设置成红色问题
请朋友们看一下这个代码有什么问题.
以下代码的功能是:把超标的数据设置成红色.
private static double[,] markValues = new double[20,2];//保存各个指标的上限和下了限.
private static string[] markTips = new string[20];//保存各个指标的上限和下了限及参数的名称,做为一个各个指标的提示.
markValues,markTips 中的值在页面第一次加载时赋值.
以下是查出数据时执行的代码.
foreach(DataGridItem item in DG_PAGE.Items)
{
if(item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
{
Label[] labels = new Label[20];
labels[0] = (Label)item.FindControl( "ii_rt ");
labels[1] = (Label)item.FindControl( "ii_yt ");
labels[2] = (Label)item.FindControl( "ii_rhumidity ");
labels[3] = (Label)item.FindControl( "ii_yhumidity ");
labels[4] = (Label)item.FindControl( "ii_rvt ");
labels[5] = (Label)item.FindControl( "ii_yvt ");
labels[6] = (Label)item.FindControl( "ii_r2vt ");
labels[7] = (Label)item.FindControl( "ii_y2vt ");
labels[8] = (Label)item.FindControl( "ii_r1t ");
labels[9] = (Label)item.FindControl( "ii_r2t ");
labels[10] = (Label)item.FindControl( "ii_y1t ");
&nbs