Preheat the oven to 350 degrees F. Grease a 1-quart casserole dish with butter.
Beat the cream cheese, creamed corn, corn, cornmeal and chopped onion in the bowl of a stand mixer with the paddle attachment until combined.
Remove the bowl from the mixer and add the milk, 3 tablespoons melted butter, beaten egg, sugar and Cheddar. Season with the salt and pepper and stir with a rubber spatula until combined.
Spread the mixture in the casserole dish and bake for 50 minutes. Let stand 10 minutes before serving.
Courtesy of Food Network Magazine, Photograph by Antonis Achilleos