Loop grid application

How I can navigate in a dataset of a grid app, I need to put a button and according to some conditions execute a process.