ASP.NET - Gridview Header size - Asked By Krishna T on 27-Jun-12 07:28 AM


How to set Gridview Only Header font-size in
dipa ahuja replied to Krishna T on 27-Jun-12 07:32 AM
Right click on the smart tag of gridview and in the properties set the item's header style :

Ravi Maurya replied to Krishna T on 27-Jun-12 07:35 AM
Do like this

<HeaderStyle BackColor="PeachPuff" Font-Italic="false" ForeColor="SaddleBrown" Font-Names="Verdana"         BorderColor="Tan" Font-Size="Larger" />
Lalit M replied to Krishna T on 27-Jun-12 07:37 AM
show this code sample

      <asp:GridView ID="gvTheGrid" runat="server" GridLines="Both" CellPadding="3" AutoGenerateColumns="false"
        BackColor="WhiteSmoke" AlternatingRowStyle-BackColor="Silver" HeaderStyle-Font-Size="Medium"
        OnPreRender="gvTheGrid_PreRender" CssClass="gvTheGrid">
          <asp:BoundField DataField="ID" HeaderText="ID" HeaderStyle-Width="60" ItemStyle-Width="60" />

Check this will get good example
TSN ... replied to Krishna T on 27-Jun-12 08:15 AM

You can set in both the ways , by programatically or using the tags..

By Programatically;

use this line of code .
GVSample1.HeaderStyle.Font.Size = FontUnit.Large;  

Using Tags:
<HeaderStyle   BackColor="DeepPink" Font-Size="Large"  />

Add the Above tag to the Gridview , and you can see the change to the gridview header 

Jitendra Faye replied to Krishna T on 27-Jun-12 08:55 AM
Use this code-

<asp:TemplateField ItemStyle-Font-Bold="true" HeaderStyle-Font-Size ="Medium">
            <asp:Label ID="lbl" runat="server" Text='<%# Eval("sold") %>'></asp:Label>

Try this and let me know.
Vikram Singh Saini replied to Krishna T on 27-Jun-12 10:26 AM
You can specify size also within gridview as:

<HeaderStyle Font-Size="12px" />