Thanks for your prompt response. I had tried that one, as I found it in one of your earlier posts. That's the one that cased the exception. I also tried:
That too gave me the same exception.
If I use EditForms mode it works, but in InPlace EditMode, it fails.