views:

646

answers:

2

Is there a way to move a row in an AdvancedDataGrid in response to an external event? In this case, I'd like to have a toolbar button that moves an item or items selected in the grid either up or down. The problem as I see it is keeping the hierarchical data source in sync with the array of item renderers and selection data on the grid.

+1  A: 

If your original data source is bindable (eg. ArrayCollection), then the datagrid should be updated when you change the original source.

CookieOfFortune
This doesn't seem to correctly update the selectedItems data. It moves the data like it should, and the moved row is still highlighted after the move, but the selectedItems data is not updated, so the next time you click on the move button the behavior is not correct.
Colfax
Hmmm... you may need to manually update the selectedItems data. I guess you would need to add code to the button click handler to set the selectedItem to the desired value after the data has been moved.
CookieOfFortune
A: 

Hey I need the same thing...I want to move my data grid rows up and dowm by clicking on move up and move down button. Please help, I am new to flex...

Ritu Bhargava