Customizing the Data-Display Grid


When Web Matrix created the MxDataGrid, it configured the grid to look a certain way. You can easily change the look of the grid, still without writing any code.

Change the grid s appearance

  1. Close the browser if it s still open.

  2. In the FriendsDisplay page in Web Matrix, select the MxDataGrid control.

  3. In the Properties window, open the Font node and set the Name property to Verdana,Arial,Helvetica. (Remember that it s common in Web applications to provide backup font names in case users don t have your first choice of fonts.)

  4. Set the Font Size property to x-small.

  5. Open the AlternatingItemStyle node in the Properties window. For the BackColor property select a light color. This will set the color of every other row in the grid.

  6. Set the PageSize property to 3. Assuming you have four or more rows, this allows you to play with paging in the grid.

  7. Run the page again to see the results of your settings.

    As you can see, you can customize the look of the grid quite a bit. If you have enough rows to make up more than one page, click the numbers at the bottom to see paging in action.




Microsoft ASP. NET Web Matrix Starter Kit
Microsoft ASP.NET Web Matrix Starter Kit (Bpg-Other)
ISBN: 0735618569
EAN: 2147483647
Year: 2003
Pages: 169
Authors: Mike Pope

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net