views:

22

answers:

1

I am using Datagrid control in flex.

I need to get the count of number of items in that Datagrid. What is the method to get that?

+1  A: 

You can find the number of items by checking the data provider for the data grid:

var count:Number = (myDataGrid.dataProvider as ICollectionView).length;

Per the documentation, data sources assigned to the data provider either implement ICollectionView already, and if they don't, they are changed to a class that does implement ICollectionView.

Wade Mueller
That really helped. Thanks
psvm