Removing event handler when grid collapses