How I created this in Illustrator CS5: I set up my project as a 5 x 5 inch document in RGB mode* (File -> Document Color Mode -> RGB Color) with the grid set to major grid lines every 1 inch and 14 minor grid lines per inch (Edit -> Preferences -> Guides and Grid -> grid line every 1 inch and 14 sub-divisions), and snap-to-grid turned on (View -> place check-mark next to Snap to Grid). Obviously, I made sure my grid was visible (View -> place check-mark next to Show Grid). I created each box as a separate square using the Rectangle Tool. To select all of the squares in a given color, I used the Magic Wand Tool.
*Note: If you are creating an image primarily for print copies (from a printer), then choose CMYK mode. I chose RGB mode because I wanted to publish this graphic on the web.