Wednesday, March 05, 2008

ASP.NET Tip #2 - Formatting a Caption on a GridView

This one is easy too, but also easy to overlook.

To format the Caption of a GridView, just add CSS to the Caption element of the css of your GridView. For example if you want to set the caption font to bold do the following:

.tipGrid Caption
{
   font-weight:bold;
}

[The above assumes you have set CssClass="tipGrid" on your GridView and you have a class called .tipGrid in your CSS file]

No comments: