Keep a hash table mapping all created MDI children to their child widgets (in your case Grid). Then use MDIClient's GetActive function to find active MDI Window in your _EndEdit subroutine.
Sadly Win32::GUI::Grid does not yet support NEM otherwise this wouldn't be a problem.
Comment on Re: Obtaining References to Child Windows in Win32::Gui MDI