Grainy chocolate often results from moisture getting into the chocolate. Make sure all your utensils and containers are completely dry before melting.