I have a gridview with a datasource (SQL Database). I want to hide a column, but still be able to access the value when I select the record. Can someone show me how to do this?
This is the column I want to hide and still want to access its value:
<asp:BoundField DataField="Outlook_ID" HeaderText="OutlookID" />
If i am not mistaken, gridview does not hold the values of boundcolumns that have the attribute visible="false". 2 things you may do here, one (as explained in the answer from V4Vendetta) to use Datakeys. Or you can change your boundcolumn to a template field. And in the item template, add a control like label, make its visibility false and give your value to that label.