16.10 Changing DataGrid Style Information You want to change the visual styles of a DataGrid control. | Technique The Web Forms designer contains several different automatic styles that you can apply to a DataGrid control. If you've used the AutoFormat function within some Microsoft Office applications, then this procedure should look familiar. To apply an automatic formatting style to a DataGrid , right-click on the DataGrid within the Web Forms designer and select Auto Format. Select a format from the list of available formats and apply it to the DataGrid . Comments Applying an automatic format is the easiest way to begin editing the style of a DataGrid because it fills in a lot of the initial values for you. However, our recommendation is to avoid something we call the FrontPage template syndrome. Microsoft FrontPage contains a lot of Web templates that you can use to quickly get a site up and running. As far as functionality, it serves its purpose and it does it quite well. When viewing a Web site that uses a FrontPage template, however, we recognize the template, which makes the site lose the small amount of professionalism it has. Of course, choosing a canned DataGrid format is far less noticeable, but you still need to know how to change the visual style without using the automatic format feature. To change the visual style of a DataGrid , right-click on the control, open the Property Builder, and select the Format tab. You see a tree control listing the various pieces of a DataGrid , including the header, footer, pager, and individual item template styles. Clicking one of these items displays the available style properties that you can change for the item. You can additionally access the Borders tab to change border styles for the DataGrid as well. |