Avoiding the Headers in DataGrid Control of Flex.

January 10, 2008

In an App When used a DataGrid control the Headers values are shown by default and to avoid it there is a property called showHeaders and the default valuse is “true” ,so to disable the headers set it to false. like: showHeaders=”false”

Thats it the headers are gone..

code Example:

<mx:DataGrid x=”98″ y=”212″ id=”dgcolor” showHeaders=”false”>
<mx:columns>
<mx:DataGridColumn headerText=”Column 1″ />
<mx:DataGridColumn headerText=”Column 2″ />
</mx:columns>
</mx:DataGrid>

The difference is visible..


Avoiding Sorting of DataGrid column on click of Header.

January 10, 2008

This is set to “true”  by default and when you click the header the column values are sorted in descending order first and on secound click it is reversed.

And the property that is set is sortableColumns and it is set to “true” by default.So to disable it set it to “false”.like: sortableColumns=”false” .

code Example:

<mx:DataGrid x=”98″ y=”212″ id=”dgcolor” sortableColumns=”false”>
<mx:columns>
<mx:DataGridColumn headerText=”Column 1″ />
<mx:DataGridColumn headerText=”Column 2″ />
</mx:columns>
</mx:DataGrid>

This shows the difference..