J
Jim Bancroft
Hi everyone,
I have a couple of TemplateColumns in my DataGrid that I need to hide from
view....yet still have their contents available in the code-behind file. My
HTML code looks like this at the moment:
<asp:TemplateColumn>
<ItemTemplate>
<input type="hidden" runat="server" id="FieldID"
value='<%#DataBinder.Eval(Container.DataItem, "myField")%>'>
</ItemTemplate>
</asp:TemplateColumn>
Not much to look at. Still, when I render the DataGrid I can see this
column. It's small (a centimeter in width, maybe?) but enough to notice.
When I set the "Visible" attribute on the TemplateColumn to False I thought
my problems were over, but after doing so my code-behind file was no longer
able to find my "FieldID" variable during postback. I've since set the
"ItemStyle-Width" attribute to zero but the column still peeks out.
Does anyone know how I can hide this column and still have my hidden form
variables available during postback? Thanks for the assist.
-Jim
I have a couple of TemplateColumns in my DataGrid that I need to hide from
view....yet still have their contents available in the code-behind file. My
HTML code looks like this at the moment:
<asp:TemplateColumn>
<ItemTemplate>
<input type="hidden" runat="server" id="FieldID"
value='<%#DataBinder.Eval(Container.DataItem, "myField")%>'>
</ItemTemplate>
</asp:TemplateColumn>
Not much to look at. Still, when I render the DataGrid I can see this
column. It's small (a centimeter in width, maybe?) but enough to notice.
When I set the "Visible" attribute on the TemplateColumn to False I thought
my problems were over, but after doing so my code-behind file was no longer
able to find my "FieldID" variable during postback. I've since set the
"ItemStyle-Width" attribute to zero but the column still peeks out.
Does anyone know how I can hide this column and still have my hidden form
variables available during postback? Thanks for the assist.
-Jim