可以在GrivdView的行绑定(RowDataBound)事件中改写
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string i = e.Row.Cells[1].Text; //Cells[I]表示列的索引,从0开始
if (i == "1")
{
e.Row.Cells[1].Text = "男";
}
else
{
e.Row.Cells[1].Text = "女";
}
}
}
转自百度知道回答
posted on 2013-10-30 15:44  死神的遗迹  阅读(420)  评论(0)    收藏  举报