日期:2014-05-17 浏览次数:20527 次
aspx.cs里写个方法: protected string SetFloor(int floor) { if(floor>0) return "F"+floor; else return "B1"; }
------解决方案--------------------
gridview行绑定里面处理下不也行么
/// <summary> /// 数据行绑定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.Cells[1].Text == "0")//如果该行第1列为0 { e.Row.Cells[1].Text="B1";//替换 } else if (e.Row.Cells[1].Text == "1") { e.Row.Cells[1].Text="F1"; } } }