I need to validate the referenced datasource item fields based on the rendering it is used in. Since the datasource items are used in multiple components I need a rendering based validation. Is it possible to achieve this in sitecore?
Indeed in case if you want to validate fields and do it exactly on rendering you have to use Sitecore Rendering Parameters. How to use that you can find here. The main idea:
After that when you click on Edit component properties on your rendering:
You will see the additional section in Control Properties window (Data on the screen below). It comes from template mentioned in 1st point:
As an example I setup Required validation rule to Text field to show that it works.