[flexcoders] Re: Programmatically select items in AdvancedDataGrid

2008-07-30 Thread whatabrain
Sorry. I missed a detail... I tried to do: grid.selectedItems.push(o). It did not cause the item to be selected. --- In flexcoders@yahoogroups.com, fourctv [EMAIL PROTECTED] wrote: You have 2 options, set either adg.selectedItems or adg.selectedIndices. --- In flexcoders@yahoogroups.com,

RE: [flexcoders] Re: Programmatically select items in AdvancedDataGrid

2008-07-30 Thread Tracy Spratt
the columns array in a dataGrid. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of whatabrain Sent: Wednesday, July 30, 2008 11:12 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Programmatically select items

[flexcoders] Re: Programmatically select items in AdvancedDataGrid

2008-07-30 Thread fourctv
adg.selectedItems and adg.selectedIndices are arrays. selectedItems is an array of objects from adg's dataProvider taht are currently selected, and it is a read/write property. selectedINdices otoh is an array of ints with indices for those same objects in selectedItems. so, to make it

[flexcoders] Re: Programmatically select items in AdvancedDataGrid

2008-07-30 Thread whatabrain
I tried your suggestion (using selectedItems, since selectedIndices is all but meaningless in a tree-view AdvancedDataGrid). Now the problem is even stranger. I add a bunch of items from the dataProvider into a new array. Then I assign the array to selectedItems. By the next line of code,

[flexcoders] Re: Programmatically select items in AdvancedDataGrid

2008-07-30 Thread whatabrain
Oops. I used grid.selectedItems[x] instead of grid.selectedItems[idx]. I don't know why x exists. So the conclusion is: Overwriting selectedItems works. Pushing elements onto selectedItems does not. --- In flexcoders@yahoogroups.com, whatabrain [EMAIL PROTECTED] wrote: I tried your

[flexcoders] Re: Programmatically select items in AdvancedDataGrid

2008-07-29 Thread fourctv
You have 2 options, set either adg.selectedItems or adg.selectedIndices. --- In flexcoders@yahoogroups.com, whatabrain [EMAIL PROTECTED] wrote: Another old question, I'm sure, but I can't find an answer anywhere on the web. How do I cause a row to be selected in an AdvancedDataGrid?