You should just pass the key events to the grid through the offerkeyevent function and the grid would take care of it by itself.
Code:
TKeyResponse MyContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
return iGrid->OfferKeyEventL( aKeyEvent, aType );
}
To get the key events make sure to add the view to the control stack doing something like :-
Code:
void CAddressBookAppUi::ConstructL()
{
BaseConstructL();
iCurrentView = CMyAppMainView::NewL( ClientRect() );
AddToStackL( iCurrentView );
}