ASPit - Totally ASP JSit - Totally JavaScript
Search PHPit

Use this textbox to search for articles on PHPit. Seperate keywords with a space.

Advertisements

An Extensive Examination of the PHP:DataGrid Component: Part 2

(Page 2 out of 2)

By default PHP:DataGrid displays all the columns that are available in the data. This may not be what you want though, and most of the time you probably want to display only a few columns. To do this you must set the AutoGenerateColumns property to false, to tell PHP:DataGrid that you want to specify the columns that should be shown.

Once you've done that, you must specify some columns to display, otherwise nothing will be displayed. To do this, you're going to have to use a new tag - the Column tag.

A simple example of a column tag would be:

That's all that's necessary to display the title column. Of course, you can specifiy additional attributes, like HeaderText or FooterText, and it's possible to use styles. Below is an example of using custom columns: