Header Font Size in Grid View

Posted on 2017-04-10
Last Modified: 2017-04-10
Hello Experts,
In a GridView, I am trying to change the font size of a Header column.  I used HeaderStyle-CssClass property.  Though it is not giving any error, it is not working.  I tried to change it to a Templete Field and used the CSS.  Still no good.  Please let me know what is the best way.

Thank you in advance.
Question by:RadhaKrishnaKiJaya
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
LVL 56

Expert Comment

ID: 42087476
need sample or link to the page or html output

Author Comment

ID: 42087511
The GridView is a regular one.  All I need is change the Header font using Style Sheet.  Because of the Company policy I will not be able to post the code.

Thank you!
LVL 56

Expert Comment

ID: 42087513
nobody can help you if you don't post html or give us link to that page or do not create a sample page...
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 52

Expert Comment

by:Ryan Chong
ID: 42087539
try use HeaderStyle-Font-Size instead:


<asp:GridView ID="GridView1" runat="server" AllowPaging="True" ShowFooter ="True"
            AllowSorting="True" AutoGenerateColumns="False"  
            DataSourceID="SqlDataSource1" EmptyDataText="No data" CellPadding="4"
            ForeColor="#333333" GridLines="None">
LVL 52

Accepted Solution

Ryan Chong earned 500 total points
ID: 42087540
to change template header's style use HeaderStyle tag, like:

<asp:TemplateField HeaderText="Compare Distance">
                        <asp:CheckBox ID="ckPostcode" AutoPostBack="true" runat="server" OnCheckedChanged="ckPostcode_CheckedChanged" />
                    <HeaderStyle BackColor="#00CC99" BorderColor="#CC00FF" Font-Bold="True" 
                        Font-Size="14px" />

Open in new window

you can set the settings via the wizard available.

Author Closing Comment

ID: 42087589
Thank you.  This is how I exactly did it.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question