Thanks Optional & Si_the_Geek for the advice.

Actually my problem is this:

I want to make the cells editable as in Spreadsheet applications like Excel etc. For this I am diplaying a textbox at the exact position of the selected cell. This creates problems when scrolling if the selected cell goes out of the display.

I have made some modifications based on your suggestions and now it seems to work ok.