Get or set cell values ​​in Datagrid progmatically

In Flex 4 using a pre-populated data grid, how can I get or set certain values ​​programmatically, IE I won’t use selectedItems, etc.

How can I refer to the cell value in row 4 of colum 6, for example.

Thank you in advance for your help.

Craig

+4
source share
2 answers

Pass the dataProvider from the DataGrid to the ListCollectionView and use the getItemAt method.

 ListCollectionView(dataGrid.dataProvider).getItemAt(requiredRow).appropriateProperty = newValue; 

Update. If the column name is dynamic, you can get it using something like:

 var data_field:String = dgViewPreview.columns[6].dataField; //for 6th column ListCollectionView(dataGrid.dataProvider).getItemAt(requiredRow)[data_field] = newValue; 
+7
source

Access to two access methods is based on the Grid DataField Mapping column on an object property or LabelFunction set to a grid column

I pasted a script with an example here http://pastebin.com/iwrnHD1c

0
source

All Articles