K.B.
Let me tell you, it's all about them testing boundaries and seeing how far you will go to apeese them. When my daughter hit that age, she did the same thing, she was very sensitive, so clingy and whiney but only for me. She'll be turning three in a month and she still pulls stuff like that...cries for something, I'll give in and give it to her and then she cries because she doesn't want it, then crying again because she doesn't want me to take it away. It's infuriating and it's all about them testing you and searching for the boundaries that you will let them cross.
They are smarter than you think and as mothers, it is very hard not to give our babies what they seem to so desperately need at the time. But you have to be strong and ignore the attempts for attention. If you give them what they are crying for, it will only enforce the whiney behavior.
Try to divert his attention, or ignore him when he's acting out and don't open that door or give him that toy. Once you do, he's won and he will do it even more. If you're somewhere like the class where you can't just ignore him and let him cry all over the place, take him to the car or outside and sit there with him while he cries. If he likes to be in the class, he'll soon learn that crying takes him away and being good lets him stay.
Make sure to praise him and give him tons of attention when he's not acting out, reinforce the possitive, ignore the negative. It is easier said than done, for sure. It's hard to do and will take a lot of time to break the habbits, but it works. He'll grow out of it, just stand your ground. I feel for you, big time. I hope it all works out.