Change QGrid to include row length and make the validRow functions more flexible