Best way to populate a datagrid dynamically in as 3?

Hi all

I’m building a datagrid and came up with this clunky code to populate rows and columns.

Can anyone suggest a better code method than this overlong if/else loop?

Thanks for looking.

Chris.

for (var j:int = 0; j < xmlList.length(); j++) {
		
           var rowRate=0;
		totWidth = j*145/reqRows;
		ySet = rowRate*89+5;
		colCount+=1;
		
		var myVar = colCount/4;
		
			//1
	[COLOR="Green"]	if (rowRate>=4 && rowRate<8) {
			xSet = 150;
			ySet -= 356;
			//2
		} else if (rowRate>=8 && rowRate<12) {
			xSet = 295;
			ySet -= 712;
			//3
		} else if (rowRate>=12 && rowRate<16) {
			xSet = 440;
			ySet -= 1068;
			//4
		} else if (rowRate>=16 && rowRate<20) {
			xSet = 585;
			ySet -= 1424;[/COLOR]
			//5
		}