Hi, I have defined the datagrid as follows
<mx:DataGrid id="dg" width="100%" height="100%" >
In the part i am trying to get the details from the database and setting the dataProvider for the DataGrid as follows.
var arrayContent:ArrayCollection = new ArrayCollection();
for(var i:int=0;i<assetClassDetails.length;i++)
{
var assetClass_:AssetItemClassVO = new AssetItemClassVO();
var array:ArrayCollection = new ArrayCollection();
var embeddableLocale:EmbeddableAssetItemClassLocale = new EmbeddableAssetItemClassLocale();
var assetClassD_:AssetItemClassLocale = new AssetItemClassLocale();
assetClass_ = assetClassDetails.getItemAt(i) as AssetItemClassVO;
array = assetClass_.assetItemClassLocale;
if(assetClass_ != null && array != null && array.length >0)
{
assetClassD_ = array.getItemAt(0) as AssetItemClassLocale;
arrayContent.addItem(new Array(assetClass_.id,assetClassD_.name,assetClassD_.description,assetClassD_.locale,assetClass_.createdby,assetClass_.createdtime,assetClass_.lastmodifiedby,assetClass_.lastmodifiedtime));
}
}
dg.dataProvider = arrayContent;
But after doing this, I am getting the column name as 1,2,3,4,5 ...8. But I want to set theColumn name as ID,Name,Description,Locale,CreatedBy,CreatedTime,LastModifiedBy,LastModifiedTime.
How do i do it?
Please help.