Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
695
GridView context menu CanPerformActionForCell Override - multiple items to return and how?
posted
Hi,

If I have two menu items for my grids context menu, how can I return them both from the following override? Your documentation states:
// Return yes for every menu item that you want to be displayed, in this case, we just want our custom one.

Here is the routine in c#. How could I return two different items for the menu?
 public override bool CanPerformActionForCell (IGGridView gridView, Selector action, IGCellPath path, NSObject sender)
  {
   return action == new Selector("sendEmail");
  }

thanks,
Paul

Parents
  • 40030
    Offline posted

    Hi Paul, 

    The method fires every menu item, so you just need to OR the stmt for any additional selectors you want to support: 

    return action == new Selector("sendEmail") || action == new Selector("otherActon") || action == new Selector("action3");
    I hope this helps clear things up. 
    -SteveZ
Reply Children
No Data