Solved

Header Font Size in Grid View

Posted on 2017-04-10
6
22 Views
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.
0
Comment
Question by:RadhaKrishnaKiJaya
  • 2
  • 2
  • 2
6 Comments
 
LVL 51

Expert Comment

by:Huseyin KAHRAMAN
ID: 42087476
need sample or link to the page or html output
0
 

Author Comment

by:RadhaKrishnaKiJaya
ID: 42087511
Huseyin,
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!
0
 
LVL 51

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...
0
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!

 
LVL 51

Expert Comment

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

like:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" ShowFooter ="True"
            AllowSorting="True" AutoGenerateColumns="False"  
            HeaderStyle-Font-Size="18px"
            DataSourceID="SqlDataSource1" EmptyDataText="No data" CellPadding="4"
            ForeColor="#333333" GridLines="None">
0
 
LVL 51

Accepted Solution

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

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

Open in new window


you can set the settings via the wizard available.
0
 

Author Closing Comment

by:RadhaKrishnaKiJaya
ID: 42087589
Ryan,
Thank you.  This is how I exactly did it.
0

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!

Join & Write a Comment

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

713 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