Reputation: 6541
I.e. im wondering how i can achieve something like
<th><span>Discount</span>PLC</th>
In declaring a gridview columns such as
<asp:TemplateField HeaderText="Discount" HeaderStyle-Width="60px" SortExpression="discount">
<ItemTemplate>
<asp:Label ID="DiscountField" runat="server" Text='<%# Eval("discount").ToString() + "%" %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
How can I add this styling to the header text ?
Upvotes: 3
Views: 7320
Reputation: 109027
Try
<asp:TemplateField >
<HeaderTemplate>
<span>Discount</span>
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="DiscountField" runat="server" Text='<%# Eval("discount").ToString() + "%" %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Make sure <th />
is in context with the table.
Upvotes: 6
Reputation: 3
There is no need of header tag inside the header template.It will create a new heading.Template field is already creating a header tag.
Upvotes: 0
Reputation: 1
There is no need of tag inside the header template.It will create a new heading.Template field is already creating a tag.
Upvotes: 0