Working with Flex and Datagrids - Customizing the Column Headers (
Page 3 of 4 )
Our current DataGrid uses the "of" dataField to name the columns. This may work in many cases, but you'll probably want to name your columns something that may be more descriptive or concise. To modify the column headers, you'll want to use the 'headerText' attribute of the DataGridColumn. So, to set our column names to 'First Name,' 'Last Name' and 'Date of Birth,' we'll modify the DataGridColums to look like this:
Customizing Column Widths
Actionscript does the work of giving our columns a default size. Unfortunately, it has no idea of how wide the column should be in order to give the user the best view. The DataGridColumn tag once again comes to our rescue. In order to set column widths, use the 'width' attribute.
<mx:DataGridColumn width="45" dataField="firstName"/>