Replacing HeaderText with Headertemplate in TemplateField
问题 I have a gridview with templatefield columns. The TemplateFields are something like this: <asp:TemplateField HeaderText="Title" SortExpression="name" meta:resourcekey="BoundFieldResource1"> <ItemTemplate> <asp:Label ID="lblTitle" runat="server" Text='<%# Bind("Name") %>' meta:resourcekey="BoundFieldResource1"></asp:Label> </ItemTemplate> I have to add a custom attribute for to the header of this columns so I removed HeaderText and added the following: <Headertemplate> <asp:Label ID=