Applying for a grant, and receiving a rejection can certainly be disappointing, not just to the project but to the amount of time you put into writing a request. It is important to learn from these opportunities. If possible, ask for feedback from the foundation, and use this information to improve your future applications.