title: Display value on a label from a specific column of the gridview which is not viewable physically
body: <p>I'm creating this thread as a followed up from my previous one <a href="https://stackoverflow.com/questions/17964878/how-to-hide-a-specific-valuecolumn-from-the-gridview/17965047?noredirect=1#17965047">here</a>.</p>
  
  <p>I'm trying to create a gridview filled some data from my database. However, as you can see from the bottom 3 boundfield, i have prevented them from appearing on my webapp.</p>
  
  <pre><code> &lt;Columns&gt;
      &lt;asp:BoundField DataField="memberreportid" HeaderText="property" SortExpression="false"/&gt;
      &lt;asp:BoundField DataField="typeofcrime" HeaderText="property" SortExpression="false" /&gt;
      &lt;asp:BoundField DataField="crdatetime" HeaderText="property" SortExpression="false" /&gt;
      &lt;asp:BoundField DataField="address" HeaderText="property" SortExpression="false" /&gt;
      &lt;asp:BoundField DataField="detail" HeaderText="property" SortExpression="false"/&gt;
      &lt;asp:BoundField DataField="incidentdate" HeaderText="property" SortExpression="false" /&gt;
      &lt;asp:BoundField DataField="incidenttime" HeaderText="victim" SortExpression="false"/&gt;
      &lt;asp:BoundField DataField="property" HeaderText="suspect" SortExpression="false" Visible="false" /&gt;
      &lt;asp:BoundField DataField="victim" HeaderText="suspect" SortExpression="false" Visible="false" /&gt;
      &lt;asp:BoundField DataField="suspect" HeaderText="suspect" SortExpression="false" Visible="false" /&gt;
    &lt;/Columns&gt;
  </code></pre>
  
  <p>I'm trying to display them out onto the label despite them not being able to see physically via the webpage. I used this method to display them out when the select button is being clicked ( I have set "AutoGenerateSelectColumn" to true)</p>
  
  <pre><code>protected void GWCase_SelectedIndexChanged(object sender, EventArgs e)
      {
          lbmemberreportid.Text = GWCase.SelectedRow.Cells[1].Text;
          lblproperty.Text = GWCase.SelectedRow.Cells[8].Text; 
          lblvictim.Text = GWCase.SelectedRow.Cells[9].Text;
          lblsuspect.Text = GWCase.SelectedRow.Cells[10].Text;
      }
  </code></pre>
  
  <p>Unfortunately, i'm only able to display out the memberreportID onto the label but not the other 3 attirbute which i believe it doesn't because i hid it physically. Is there any other method apart from the one i attempted to display out the specific value when being selected in the gridview?</p>
  
  <p><strong><em>UPDATED</em></strong></p>
  
  <p>Page_load binding</p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
      {
  
          if (!IsPostBack)
          {
              LoadGrid();
          }
  
  
      }
  
      private void LoadGrid()
      {
          SqlConnection conn = new SqlConnection();
          conn.ConnectionString = "Data Source = localhost; Initial Catalog = MajorProject; Integrated Security= SSPI";
          conn.Open();
  
          DataSet ds = new DataSet();
  
          SqlDataAdapter da = new SqlDataAdapter("SELECT memberreportid, typeofcrime, crdatetime, address, detail, incidentdate, incidenttime, property, victim, suspect, detail, suspectdetail, propertydetail from memberreport", conn);
          da.Fill(ds);
  
          GWCase.DataSource = ds.Copy();
          GWCase.DataBind();
  
          conn.Close();
  
          ddlpid1.Visible = false;
          ddlpid2.Visible = false;
          ddlpid3.Visible = false;
          ddlpid4.Visible = false;
          ddlpid5.Visible = false;
          ddlpid6.Visible = false;
          ddlpid7.Visible = false;
          ddlpid8.Visible = false;
          ddlpid9.Visible = false;
          ddlpid10.Visible = false;
      }
  </code></pre>
  
  <p>Trying to read the hidden field</p>
  
  <pre><code>protected void GWCase_PageIndexChanging(object sender, GridViewPageEventArgs e)
      {
          LoadGrid();
          GWCase.PageIndex = e.NewPageIndex;
          GWCase.DataBind();
      }
  </code></pre>