Flex selectDatagrid()
"omg, murloc, it's a post that's not about video games!"
Problem: You programmically are selecting an item from a datagrid.
Solution: The function below! Pass the datagrid, column you're matching, and the value to match on.
if( value == null )
return;
for( var i:int=0; i<dg.dataProvider.length; i++ ){
if( value == String(dg.dataProvider[i][column]) ){
dg.selectedIndex = i;
dg.verticalScrollPosition = i;
break;
}
}
}

