如果數據源有某一列,而在綁定到GridView時不顯示該列,編程時要用到該列的值可以用以下方法: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView dr = (DataRowView)e.Row.DataItem; if (dr["btype"].ToString() == "1") e.Row.ForeColor = System.Drawing.Color.Red; } }