The datagrid should have a few events for this.

Follow this tutorial:

http://www.youtube.com/watch?v=MS1lzB-dcsk

It shows you how to do it at the end.

Flosculus