also tried to work with verticalScrollPosition and scrollToIndex but doesn't seem to work. Maybe I need to use some kind of refresh first ? Does this exist for a datagrid ?
--- In flexcoders@yahoogroups.com, "amigo_fd" <[EMAIL PROTECTED]> wrote: > > Hello, > > I can set the selectedIndex to the correct row, but if that row is not > in the visible area, the datagrid should scroll to that row. How can > this be done ? > > Now I use this code to set the selected row to the desired one: > > > var SelectedProductIndex:int = 0; > > private function FillDatagridSearchresult(): void { > var x:XML = new XML(WsProducts.WsFindProductsImport.lastResult); > > datagridProducts.dataProvider = new XMLListCollection(x.children()); > > if (SelectedProductIndex > (datagridProducts.dataProvider.length - 1)) { > SelectedProductIndex = datagridProducts.dataProvider.length - 1; > } > > datagridProducts.selectedIndex = SelectedProductIndex; > } >