for (var i:Number = 0; i < authorGrid.dataProvider.length; i++) { if (authorGrid.dataProvider[i].authorId == authorId) { authorGrid.selectedIndex = i; } }