PDA

View Full Version : XML, datagrid, and incorrect selectedIndex


coolaj86
06-10-2008, 12:30 AM
I'm developing an application using the sample code shown at the page below, but when using the sorting feature of the datagrid it loads data which doesn't correlate correctly to the xml source being used. How can I fix this?

Example:
http://www.adobe.com/devnet/flex/quickstart/accessing_xml_data/#section2

If you scroll down to the Result section you will see the 'working' example. Double click on the ISBN column to change it's sort direction and then click again on one of the available example books.

Notice that it loads the wrong data.

The quickest solution seems to be to disable sorting.
<mx: DataGrid
....
sortableColumns=”false”>

However, I would like to be able to use sorting and much of the code in my application depends on the selectedIndex.

coolaj86
07-15-2008, 11:21 PM
Store the selectedItem and check that against something rather than the selected index.