Can someone help me figure out how to hide my asp:BoundField using CSS without losing access to the values? I've tried setting visible=false, but that prevents me from accessing the values. Then I attempted to hide it with CSS, but that doesn't work because CSS is not allowed in BoundFields. I also tried using an UpdatePanel or a div, but those options are not allowed either. Any suggestions on how I can successfully hide my BoundField with CSS?
Here is the code snippet of what I want to hide with CSS:
<asp:BoundField DataField = "compras_id" HeaderText="Compras ID" HtmlEncode="false" />
<asp:BoundField DataField = "numero_contrato" HeaderText = "Numero contrato" HtmlEncode="false" />
... (additional BoundField elements)
This is the CSS I'm currently using:
.myHide {
display:none;
}
And here's why I need to hide the BoundFields - this is my front-end code snippet:
<asp:GridView>
... (more GridView layout details)
<Columns>
<!-- Code section where BoundFields are included -->
</Columns>
</asp:GridView>
For reference, this is part of my backend logic:
private void GetSelectedRows() {
// Logic for selecting rows
}
// Additional backend methods and functions...
To summarize, I am trying to find a way to hide certain BoundFields in my ASP.NET application using CSS without losing access to the data they contain.