Hello,
~Johnny~ wrote:
I tired different things like adding dataGrid.Scroll -= new ScrollEventHandler(dataGrid_Scroll); dataGrid.KeyPress -= new KeyPressEventHandler(dataGrid_KeyPress); beofre assigning dataGrid to the new FinderDataGridView object but stil doesn't work.
Although, it is not solving your problem, you should always unregister the event like this, bevor creating a new instance, cause the old instance will not be cleared by the GC. I think the problem could be that you are not removing the old dataGrid instance out of the datagridSplit.Panel2.Controls. If your dataGrid instance has a dispose method, you also should call it. Hope it helps! All the best, Martin