I was suprsised to find out that there seems to be no built in method to set a datagrid's selected index(?)
I have been googling about this and this is what I've done so far:
private function setDatagridIndex(selectedHeader:String):void
var gData:Object = uutisdg2.dataProvider;
for(var i:Number=0; i < gData.length; i++)
var thisObj:Object = gData.getItemAt(i);
if(thisObj.otsikko == selectedHeader)
uutisdg2.selectedIndex = i;
This function takes the selected row's string-value as a input parameter. The if-clause seems to work (loop finds the correct row).
But the selection of a row does not work yet, I can't figure out what I'm missing here. I understand that the way to go is to loop through all the values in the datagrid and then set the correct index in that loop.
Could you please post a deep-link to your article instead of the blog entry page? I can't find the article you had on your home page when you posted this forum reply.