K
Kasey Rybic
I am trying to put data from a field of a query in to the HeaderText arg and
I keep getting an error.
<aspataGrid id="dgMainCompany" runat="server" width="55%"
HorizontalAlign="Left"
AutoGenerateColumns="False"
BackColor="WhiteSmoke"
Font-Name="Verdana"
Font-Size="11pt">
<HeaderStyle BackColor="Thistle" ForeColor="Black" Font-Bold="True" />
<Columns>
<asp:TemplateColumn HeaderText=I_WANT_TO_PUT_COMPANY_NAME_HERE>
<ItemTemplate>
<table width="100%">
<tr>
<td><%# Container.DataItem("Address") %><br/>
<%# Container.DataItem("City") %>, <%# Container.DataItem("State")
%> <%# Container.DataItem("Zip") %></td>
</tr>
<tr>
<td><%# Container.DataItem("Phone1") %><br/>
<%# Container.DataItem("Fax") %></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</aspataGrid>
See section I_WANT_TO_PUT_COMPANY_NAME_HERE, I have tried several
permutations of <%# Container.DataItem("CompanyName") %> and can not get it
to work correctly. It works fine if I hard code in a string "COMPANY_NAME"
but I need to get the value here. Any feedback is always appreciated.
Thanks everybody. Happy Coding!
CK
I keep getting an error.
<aspataGrid id="dgMainCompany" runat="server" width="55%"
HorizontalAlign="Left"
AutoGenerateColumns="False"
BackColor="WhiteSmoke"
Font-Name="Verdana"
Font-Size="11pt">
<HeaderStyle BackColor="Thistle" ForeColor="Black" Font-Bold="True" />
<Columns>
<asp:TemplateColumn HeaderText=I_WANT_TO_PUT_COMPANY_NAME_HERE>
<ItemTemplate>
<table width="100%">
<tr>
<td><%# Container.DataItem("Address") %><br/>
<%# Container.DataItem("City") %>, <%# Container.DataItem("State")
%> <%# Container.DataItem("Zip") %></td>
</tr>
<tr>
<td><%# Container.DataItem("Phone1") %><br/>
<%# Container.DataItem("Fax") %></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</aspataGrid>
See section I_WANT_TO_PUT_COMPANY_NAME_HERE, I have tried several
permutations of <%# Container.DataItem("CompanyName") %> and can not get it
to work correctly. It works fine if I hard code in a string "COMPANY_NAME"
but I need to get the value here. Any feedback is always appreciated.
Thanks everybody. Happy Coding!
CK