[verb (plain)] + のに [i-adj] + のに [na-adj] + な + のに [noun] + な + のに [na-adj] + だった + のに [noun] + だった + のに [sentence] + のに。 [verb (dictionary form)] + のに + 便利だ / 必要だ / かかる / 使う
のに means "even though": the second half is not what the first half should have led to, and you are surprised, disappointed or annoyed about it. It follows the plain form, and the plain form stays even when the sentence ends in です or ます.
A な-adjective or a noun takes な before のに, not だ. In the past it is だった: やすみ休みだったのに.
These go beyond のに in the middle of a sentence.
Leave off the second half and のに ends the sentence on a complaint or a regret. After ば or たら with いい or よかった, it wishes things were otherwise.
After the dictionary form, のに can also mean "for", "to": what something is good for, or what it takes. This のに carries no complaint.
The main clause is a judgement or a cost – べんり便利, やくにたつ役に立つ, ひつよう必要, かかる, つかう使う. For a goal you go out and act on, use ために.