protected void ddlApprovedStatus_SelectedIndexChanged(object sender, EventArgs e) { DropDownList ddl = (DropDownList) sender; if (ddl.SelectedIndex == 1 ) // Approved { // this.ProfilesGrid.Columns[0].Visible = false; this.ProfilesGrid.Columns[1].Visible = false; this.ProfilesGrid.Columns[4].Visible = true; } else { // this.ProfilesGrid.Columns[0].Visible = true; this.ProfilesGrid.Columns[1].Visible = true; this.ProfilesGrid.Columns[4].Visible = false; }>Dear all:
> GrdView.DataSource = myRead; > GrdView.DataBind(); > MultiView1.ActiveViewIndex = 10; >>But there are some columns of my query result that I do not want to show in the grid view but which their values are of important later for selection of records in the grid view.
GrdView.Columns[3].Visible = false;
>but this did not make the column invisible.>for (int i = 0; i < GrdView.Rows.Count; i++) > GrdView.Rows[i].Cells[3].Visible = false; >>But this will move all the values of the columns following column 3 to the one column before them and the column header won’t change and also the last column has no value but the header that stayed.