I am using an mx:DataGrid with a dataProvider to display Rows. I have checked the no of rows in my array ( which is 8 ) and the no 开发者_运维知识库of rows in the dataGrid. They both match, however I always get an extra blank row at the end of my data grid. How can I remove this row?
Regards Aparna
try this : How can I make datagrid height is equal to data content in Adobe Flex an example based on the answer I found there:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:DataGrid x="31" y="157" id="dg" rowCount="{dg.dataProvider.length}"> <mx:dataProvider> <mx:ArrayCollection> <mx:Object name="name1" date="25/11/2010" /> <mx:Object name="name2" date="24/11/2010" /> <mx:Object name="name3" date="23/11/2010" /> </mx:ArrayCollection> </mx:dataProvider> </mx:DataGrid> </mx:Application>
One more thing ,dont specify the height of the grid explicitly in the mx:DataGrid tag.
Keep changing the size of your data grid in the design view so that it must be able to accomodate only fixed number of rows. Keep scroll policy false.
The new spark DataGrid control appears to solve this problem.
精彩评论