//过滤赤字及生成办公室费用链接
for (int i = 0; i <= gridView.Rows.Count - 1; i++)
{
DataRowView mydrv = ds.Tables[0].DefaultView[gridView.PageIndex * gridView.PageSize + i];
if (mydrv[1].Equals("办公室")) {
gridView.Rows[i].Cells[1].Attributes.Add("style", "cursor:pointer;color: #0000FF");
gridView.Rows[i].Cells[1].Attributes.Add("onclick", "ShowIframe('办公室计划执行情况表查询','/super/bgs.aspx',2200,300)");
}
for (int j = 2; j < 34; j++)
{
string score = Convert.ToString(mydrv[j]);
if (!score.Equals("") && Convert.ToDouble(score) < 0)//大家这里根据具体情况设置可能ToInt32等等
{
gridView.Rows[i].Cells[j].ForeColor = System.Drawing.Color.Red;
}
}
}
gridview分页情况下绑定数据时,赤字的过滤
最新推荐文章于 2019-07-05 03:05:30 发布