G
Guest
Hi,
I have a GridView with a fixed number of columns being returned from a SQL
query and each having a simple template:
<asp:TemplateField HeaderText="Allocations">
<edititemtemplate>
<asp:TextBox id="txt89" runat="server" Text='<%# Bind("89") %>' asp:TextBox>
</edititemtemplate>
</asp:TemplateField>
Where 'Allocations' is the display name and '89' is the field name and these
are the only differences from template to template.
I need to hide some of the columns (a different set of columns depending on
the query parameters) when the values for the columns are null.
To make this easier I have a query I've fed into a dataset that gives the
list of field IDs to show. The problem I have is to turn the name of the
field (the 89) from the query into the index of the column which is required
to do the hiding/showing. I can't use the HeaderText property of the
templatefield as it is different to the fieldID. Any ideas?
TIA,
Rob
I have a GridView with a fixed number of columns being returned from a SQL
query and each having a simple template:
<asp:TemplateField HeaderText="Allocations">
<edititemtemplate>
<asp:TextBox id="txt89" runat="server" Text='<%# Bind("89") %>' asp:TextBox>
</edititemtemplate>
</asp:TemplateField>
Where 'Allocations' is the display name and '89' is the field name and these
are the only differences from template to template.
I need to hide some of the columns (a different set of columns depending on
the query parameters) when the values for the columns are null.
To make this easier I have a query I've fed into a dataset that gives the
list of field IDs to show. The problem I have is to turn the name of the
field (the 89) from the query into the index of the column which is required
to do the hiding/showing. I can't use the HeaderText property of the
templatefield as it is different to the fieldID. Any ideas?
TIA,
Rob