By the way, what is the advantage of different positions on the grid? Do the melee attackers get more hits when they are close up? Do they take more hits if they're the front line?
Every unit acts differently depending on which row it is located, and it can only attack/be attacked by enemies in certain columns.
For example, an Amazon in the front or middle row only gets to attack once per battle, but if you stick her in the back row she attacks twice per battle instead. Fighters are the opposite: front row gets them two attacks, middle and rear only buys them one. Additionally, a small number of units to have completely different attacks if they switch rows: the Paladin, for instance, does a melee attack from the front or middle rows, but uses magic if he's in the back.
For the columns, a unit can only attack enemies that are in the same column as it is, or one column adjacent. This means that a unit you have on the far right can only attack enemies on the far right or the center column, and it can only attack enemies in the far left column when the right and middle columns have been cleared of enemies. One last note: units with projectiles (arrows, magic, etc.) must attack whoever is the furthest back in a column before they can attack who's in front, and melee units have to do the opposite. So if the enemy leader is in the front center, and a enemy Soldier is in the rear center, your Amazon will attack the enemy Soldier instead of the enemy leader, even if your unit is set to Attack Leader.
It's a bit complicated, and not well explained in the game (despite being incredibly important...), so let me know if I didn't make much sense, and I'll try to explain it better.