ASP.NET Logo Back to WebMatrix Home

 
ASP.NET Pages with Data
Format the DataGrid
In this walkthrough, you will change the formatting options to alter the look and feel of the DataGrid.
  1. Open the myFirstDataPage.aspx file in Design view.

     
  2. Select the Design tab.

     
  3. Select the DataGrid.

     
  4. Click the Auto Format link at the bottom of the Properties window.

     
  5. The Auto Format dialog box will appear. The Auto Format dialog box allows you to select a predefined set of colors, border styles, and other settings (referred to as a scheme) and apply them to the DataGrid control. 

    DataGrid AutoFormat Dialog

  6. Select the Simple 1 option in the scheme ListBox. When you select a scheme, the scheme's settings are applied to properties of the control. Note the preview of how the DataGrid will look with the scheme applied.

     
  7. Click OK

    DataGrid AutoFormat Preview

  8. Save and run the ASP.NET page.

     
  9. Your ASP.NET page will automatically appear in a new instance of your Web browser.

     
  10. Type 1 into the TextBox and press the Button. Note that the MasterGrid implements the formatting options of the Simple 1 scheme. 

    DataGrid With Formatting

  11. Close the Web browser instance.

Next Step >>