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 53

Expert Comment

by:Huseyin KAHRAMAN
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 53

Expert Comment

by:Huseyin KAHRAMAN
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...
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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

Industry Leaders: 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

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.

751 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