If you ever find yourself in need of styling multiple controls in your project you have noticed that individually modifying the css is very time consuming. A quicker way would be to copy the ASP.NET code and paste it where ever it is needed - still quite time consuming. A better way to do this would be using ASP.NET theme's. This article will demonstrate how to add a theme to an ASP.NET GridView control.
Themes are basically a folder that can contain images, css files, and skin files as well as whatever else you might want. To add themes to your website simply right click on your parent website in your solution explorer and select "Add ASP.NET Folder" > "Theme". This creates an App_Themes directory in your website. Then every child folder under App_Themes is it's own individually styled theme.
Within the App_Themes, I created a folder called AGRC. Now I have a theme titled AGRC. I then created an AGRC.skin file, an AGRC.css file, and a folder called images.
Inside my images folder I added a purple gradient GIF file. Then, within the AGRC.css file I created a style called GridView_Header.
Finally, I added a line to my web.config file to tell it what theme to use.
<system.web> <pages theme="AGRC"/> </system.web>
Now every GridView control that I use will use this style if EnableThemeing = true (which it does by default). If I wanted to have multiple themes for the GridView the gridview control has a property called SkinID where you can specify which theme to use.