Q:

Choosing 'Edit Web Part' is selecting the wrong instance of the web part

I've created a custom web part and I've added three instances of the same web part in a page. If I try to edit the second web part it is opening the tool part for the third web part.
In fact whatever web part I edit it just opens the tool part of the instance of the web part that is added in the page in the last (latest). If I have added 10 web parts editing any web part from 1-9 just opens the tool part of the 10th instance of the web part.
Any ideas?

A:

Ok, I've fixed it. But I seriously doubt whether this is a bug in SP 2010. In the web part class I just commented the OnInit() method and it worked. This was the method -
/// <summary>
/// init
/// </summary>
/// <param name="e"></param>
protected override void oninit(eventargs e)
{
    this.title = "My Title";
}

Any comments on this?

