110,537
社区成员
发帖
与我相关
我的任务
分享
sqldap.SelectCommand = cmm;
DataTable dt = new DataTable();
sqldap.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[5].Text == "1233456")//123456 是部门代码
{
e.Row.Cells[5].Text = "XXX";//xxx代表部门汉字名称
}
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string text = e.Row.Cells[4].Text.ToString();//下标从0开始,要修改第5列
if (text.Equals("123456"))//123456是部门代码
{
text = "XXX";//xxx代表部门汉字名称
}
e.Row.Cells[4].Text = text;
}
}