我有数据集,如下所示。我想隐藏前三列。但是我在下面做的方式不起作用。我该如何隐藏它们?
// Read all posts and fill gridview
//////////////////////////////////////////////////
DbCommand dbCommand2;
dbCommand2 = db.GetStoredProcCommand("PC_Select_News");
db.AddInParameter(dbCommand2, "UserId", DbType.Guid, new Guid(Session["SessionUserId"].ToString().Trim()));
DataSet ds = db.ExecuteDataSet(dbCommand2);
grid_all_posts.DataSource = ds;
grid_all_posts.DataBind();
grid_all_posts.Columns[1].Visible = false;
grid_all_posts.Columns[2].Visible = false;