Try this...

Given:

1. The grid's dataProvider is bound to a bindable var named "dp"
[Bindable] private var dp:ArrayCollection;

2. A DataGrid with an id="grid"...
<mx:DataGrid id="grid" dataProvider="{dp}"...

3. Data in the dataProvider are Objects of some sort

// To get the target row of the Object
// I want to view as if someone clicked on it
grid.selectedIndex = dp.getItemIndex(someTargetObject);

// Fire an event programmatically as if someone clicked on a row
if (grid.selectedIndex > -1) {
 grid.dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK));
}

// Ensure that the row is highlighted and displayed
grid.verticalScrollPosition = grid.selectedIndex;

Hope this helps...

Bob I.


--- In flexcoders@yahoogroups.com, "menapole" <michael.napol...@...>
wrote:
>
> Can someone tell me if it is possible to select a row in an advanced
> data grid programmatically such that not only is the row selected but
> the click that would have been dispatched had I done a real click via
> the UI is also dispatched?
>


Reply via email to