Is there a possibility to hide a column from gridview even if you get that value from DB?
I have populated a grid view with some columns from database with following procedure sending a parameter:

SqlConnection sqlConn = new SqlConnection(StringKoneksioni.Stringu);

           using (sqlConn)
           {
               SqlCommand sqlCmd = new SqlCommand("procProcedureName", sqlConn);

               sqlCmd.CommandType = CommandType.StoredProcedure;

               sqlCmd.Parameters.Add(new SqlParameter("@Parameter", SqlDbType.VarChar));

               sqlCmd.Parameters["@Parameter"].Value = Session["Parameter"];

               sqlConn.Open();

               SqlDataReader reader = sqlCmd.ExecuteReader();

               gvName.DataSource = reader;

               gvName.DataBind();

             ///All I want is to hide the following column from grid view but use its value. How to solve this?
               gvName.Columns[10].Visible = false;
               sqlConn.Close();

           }

P.S. My question is set on the comment code above.
Thank you in advance for your reply.
Cheers.

I believe you falls into the same issue as this post where the OP misunderstood the grid view property.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.