@rasterweb Tips for next time if you're interested (having run into this problem myself on multiple occasions):
1. If you run out of powdered sugar, and it is being used in a heat-thickened recipe, it is essential to know that powdered sugar has about 2-3 teaspoons of cornstarch in every cup. If all you have is granulated sugar and you substitute and wait for it to thicken, it will take a *very* long time and you will end up with either something dribbly that needs skewers to hold the top layer in place, or something that solidifies into blobs of fudge the second you attempt to spread it.
2. If your frosting has a liquid as well as powdered sugar, you may be able to reduce the grittiness by dissolving substituted granulated sugar in the liquid before adding it. (Heat can help with this.) However, even if this frosting isn't very gritty to start with, it will develop a crunchy crust over time.
3. If you prefer not to substitute (not always an option, I know, especially after the butter is already in the bowl), it is sometimes possible to get away with making a smaller quantity by substituting something else on hand for the filling. Raspberry jam is particularly good as chocolate cake filling.