How to change the gridview font?

How to change the font gridview in windows form?

+6
source share
1 answer

You can use the property ItemStyle-Font-Nameson each BoundField to change the font of the elements in the grid, and you can use the property HeaderStyle-Font-Namesto change the headers.

If you want to use css read ...

You can also use HeaderStyle-CssClass="gridview-header", then you can define a css class to style:

.gridview-header
{
    font-weight: bold;
    font-size: 10px;
    padding-bottom: 3px;
    color:  #666666;
    padding-top: 3px;
    font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
    background-color: #EEEEEE;
}

And you can define the css class for the whole gridview by setting the gridview property of CssClass:

CssClass="gridview"

Then you can set the tr property (tr is what gridview displays for rows) and set the font in your css file:

.gridview tr
{
    /* set font properties here */
}

css css (, StyleSheet.css). aspx ( , MVC) , , , StyleSheet.css Styles :

<head id="Head1" runat="server">
    <link href="Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
+6

All Articles