隱藏GridView

摘要:隱藏GridView

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
    if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)
    {
    e.Row.Cells[2].Visible = false;
    }
    }