Vishal
Vishal

Reputation: 2752

Getting dataFields of DataGridColumn into ArrayCollection

I have a DataGrid with 3 DataGridColumns. All 3 of them have separate dataFields.

I need to get the datafields into an ArrayCollection and pass it to a funciton. I dont want to hard code the ArrayCollection.

Is there any way to achieve this?

Upvotes: 0

Views: 784

Answers (1)

JeffryHouser
JeffryHouser

Reputation: 39408

Something like this:

var dataFieldCollection : ArrayCollection = new ArrayCollection();
for each (dataGridColumn : DataGridColumn in dataGrid.columns){
 dateFieldCollection.addItem(dataGridColumn.dateField);
}

This is psuedo code I wrote in the browser.

Upvotes: 1

Related Questions