gridview 字體顏色怎么改?
來源:新能源網(wǎng)
時間:2024-08-17 13:29:01
熱度:
gridview 字體顏色怎么改?【專家解說】:protected void GridView1_RowDataBound(object sender, GridViewRowEv
【專家解說】:protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string str = e.Row.Cells[0].Text;
//Cells[0]為第一列
if (str== "未接收")
{
e.Row.Cells[0].BackColor = System.Drawing.Color.Red;
}
//查找關(guān)鍵字
if (str.Contains("keyName"))
{
string newStr = "<font color=red>" + str + "</font>";
e.Row.Cells[0].Text = str.Replace("班keyName", newStr);
}
}
}
這給你懶的!我是復(fù)制我自己的代碼 當(dāng)然有的地方稍微有點(diǎn)不同
你自己看看 應(yīng)該很容易解決 因?yàn)槲铱梢赃\(yùn)行
就是 數(shù)字改改 名字改改!
-
急?。∩N顏色的花能不能列舉十種?2024-08-17
-
現(xiàn)在太陽能集熱真空管什么顏色好2024-08-17
-
中石油中石化93號汽油顏色不同 哪種好2024-08-17
-
太陽能電池板為什么不能是別的顏色?2024-08-17
-
燃燒火焰是什么顏色熱值最高?2024-08-17
-
燃燒火焰是什么顏色熱值最高?2024-08-17
-
太陽能電池板有哪些顏色2024-08-17
-
古代代表顏色的字,詞?2024-08-17
-
碳纖維材料能不能上顏色?為什么?2024-08-17
-
93號汽油顏色發(fā)紅會不會用?2024-08-17
-
暴風(fēng)海蛇補(bǔ)給基地的炮火蘭頭發(fā)是什么顏色?2024-08-17
-
為什么中石化中石油的93號汽油的顏色不一樣那2024-08-17
-
為什么人吹蠟燭,蠟燭會熄滅?化學(xué)知識,會的答下哦。錳酸鉀是什么顏色的?2024-08-17
-
93號汽油的顏色為什么像白開水樣2024-08-17
-
太陽能熱水器電加熱時,漏電保護(hù)器的指示燈亮,是綠顏色的,但溫控儀上的溫度不上是怎么回事?應(yīng)該怎么修?2024-08-17