You can use the ItemStyle-Font-Names property on each BoundField to change the font of the items in the grid, and you can use the HeaderStyle-Font-Names property to change the headers.
If you want to use css, read on...
You can also use a HeaderStyle-CssClass="gridview-header", then you could define a css class to do the styling:
And you could define a css class for the entire gridview, by setting the gridview's CssClass property:
CssClass="gridview"
Then, you can set the tr property (the tr is what the gridview renders for rows) and set the font there in your css file:
.gridview tr
{
/* set font properties here */
}
When using css in a project, you usually have a css file (call it StyleSheet.css, for example). Then in your aspx pages (or views if you're using MVC), you can include the stylesheet like this, assuming the StyleSheet.css is in a folder called Styles in the site root folder:
发布评论
评论(1)
您可以使用每个 BoundField 上的
ItemStyle-Font-Names
属性来更改网格中项目的字体,并且可以使用HeaderStyle-Font-Names
属性来更改网格中项目的字体。更改标题。如果您想使用 css,请继续阅读...
您还可以使用
HeaderStyle-CssClass="gridview-header"
,然后您可以定义一个 css 类来进行样式设置:您可以定义整个 gridview 的 css 类,通过设置 gridview 的 CssClass 属性:
然后,您可以设置 tr 属性(tr 是 gridview 为行呈现的内容)并在 css 文件中设置字体:
在项目中使用 css 时,您通常有一个 css 文件(例如,将其称为
StyleSheet.css
)。然后,在您的 aspx 页面(或视图,如果您使用 MVC)中,您可以包含这样的样式表,假设StyleSheet.css
位于名为Styles
的文件夹中站点根文件夹:You can use the
ItemStyle-Font-Names
property on each BoundField to change the font of the items in the grid, and you can use theHeaderStyle-Font-Names
property to change the headers.If you want to use css, read on...
You can also use a
HeaderStyle-CssClass="gridview-header"
, then you could define a css class to do the styling:And you could define a css class for the entire gridview, by setting the gridview's CssClass property:
Then, you can set the tr property (the tr is what the gridview renders for rows) and set the font there in your css file:
When using css in a project, you usually have a css file (call it
StyleSheet.css
, for example). Then in your aspx pages (or views if you're using MVC), you can include the stylesheet like this, assuming theStyleSheet.css
is in a folder calledStyles
in the site root folder: