greets, long time without doubts
my question is:
i have 2 DataGrids the first one has one fixed column , the second one has 4 fixed columns
i use a button to convert the rows of the DataGrid 1 in columns, then if i delete a row in the DataGrid 1 it must delete the corresponding column in the DataGrid 2
how i can delete the columns of DataGrid 2 in that way???
If you want to delete the content of the column, you must work on the DataGrid's dataProvider.
If you want to remove the column, you can use :
var columnsCollection :ArrayCollection = new ArrayCollection( yourDataGrid.columns ); columnsCollection.removeItemAt( columnsCollection.getItemIndex( youDataGridColumn ) ); yourDataGrid.columns = columnsCollection.toArray();
You don't have to wrap the columns in an ArrayCollection, you can use splice
directly, although the ArrayCollection APIs are easier to use.