Preheat an oven to 325 degrees F (165 degrees C). Grease a 9x13 inch baking dish.
Whisk together the cornmeal and baking soda in a small bowl; set aside. Beat the eggs in a mixing bowl; stir in the whole kernel corn, cream-style corn, buttermilk, melted margarine, green chiles, and onion. Stir in the cornmeal mixture and 2 cups of the Cheddar cheese until only slight lumps of cornmeal remain; pour into the prepared baking dish.
Bake uncovered in the preheated oven until firmed and lightly browned, about 1 hour.
Remove from the oven, and sprinkle with the remaining cheese; let stand 15 minutes before serving.