62,047
社区成员
发帖
与我相关
我的任务
分享
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.Contains("keyWord"))
{
string newStr = "<font color='red'>" + str + "</font>";
e.Row.Cells[0].Text = str.Replace("keyWord", newStr);
}
}
}