you might be able to make use of the headerRelease event to reset your selectedItem.
DK On Mon, Mar 31, 2008 at 3:17 PM, cobpez <[EMAIL PROTECTED]> wrote: > Yes, looking at the data in the debugger I can see the that the id is > still matching. Really strange. Maybe I should not rely on the > DataGrid doing the sorting and instead take the bother to sort the > underlying data? As I understand the documentation that should > automatically sort the DataGrid. > > Or maybe I should try set up a really simple example that exposes my > problem and then maybe someone can see what I am doing wrong? > > Flex has really got me hooked! It's a bloody awesome development > environment. > > > /PEZ > --- In [email protected] <flexcoders%40yahoogroups.com>, "Alex > Harui" <[EMAIL PROTECTED]> wrote: > > > > The XML node and its UID should not have changed, so the expression you > > used should be good as long as space_item.id does in fact match an id > > attribute in the original data. Did you verify that space_item.id is > > correct? > > > > > > > > ________________________________ > > > > From: [email protected] <flexcoders%40yahoogroups.com> [mailto: > [email protected] <flexcoders%40yahoogroups.com>] On > > Behalf Of cobpez > > Sent: Monday, March 31, 2008 12:55 AM > > To: [email protected] <flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Re: What happens with dataProvider when you sort a > > List control? > > > > > > > > It sure makes me wiser, thanks! Now let me try to explain my issue a > > bit clearer. Maybe it's this simple: > > > > I want to keep the selection in the datagrid in sync with the > > selection of the same data in another part of the application. But > > when I sort the data in the datagrid I lose the references, becauase > > of the mechanism you mention. > > > > Maybe I can just copy the reference to the new item list in the > > datagrid. Or if there's some property I can set that does it for me. > > It seems to me like the problem is quite general. > > > > /PEZ > > > > --- In [email protected] <flexcoders%40yahoogroups.com><mailto: > flexcoders%40yahoogroups.com> > > , "Alex Harui" <aharui@> wrote: > > > > > > The DP makes a new copy of the items and sorts them, leaving the old > > > items in their original untouched array or xmllist. > > > > > > > > > > > > I don't quite get your issue, but I hope that helps. > > > > > > > > > > > > ________________________________ > > > > > > From: [email protected] <flexcoders%40yahoogroups.com><mailto: > flexcoders%40yahoogroups.com> > > [mailto:[email protected] <flexcoders%40yahoogroups.com><mailto: > flexcoders%40yahoogroups.com> > > ] On > > > Behalf Of cobpez > > > Sent: Sunday, March 30, 2008 9:12 AM > > > To: [email protected] <flexcoders%40yahoogroups.com> <mailto: > flexcoders%40yahoogroups.com> > > > Subject: [flexcoders] What happens with dataProvider when you sort a > > > List control? > > > > > > > > > > > > Hello, I just found both Flex and this group. So here a newbie > > problem: > > > > > > I have a DataGrid (AdvancedDataGrid even) that gets populated from an > > > XML source. Selecting an item in the list selects it in another place > > > of the application too (let's call it "Space") and also some of the > > > item's data is shown in a form. Additionally clicking the item in > > > Space selects it in the list and that form is populated the same way. > > > The way I link from Space to the list is through an "id" attribute of > > > the Space items. Something like so: > > > > > > list.selectedItem = _xml_source.items.item.(@id==space_item.id); > > > > > > It all works well until I sort the DataGrid. Then that selection > > > expression returns null. I've tried see why in the debugger, but I > > > can't see it. What am I missing here? > > > > > > > > -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it?

