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
739
finding menu items by text in code if not at root level
posted

In my code it appears that the find by text method is not recursive.  That is, if I get a menu reference and want to go to a node that's 2 layers deep, this does not work:

DataMenuItem favItem= mnuMain.Items.FindDataMenuItemByText("My Favorites");

it returns null.

Instead I have to do this:

DataMenuItem favItem= mnuMain.Items.FindDataMenuItemByText("My Reports").Items.FindDataMenuItemByText("My Favorites");

 

Is this by design?

Parents
  • 6748
    Verified Answer
    posted

    Hello freecellwizard,

     

    This method FindDataMenuItemByText is not recursive by design. It searches only the collection, for which it is called, for a DataMenuItem, which's Text property is equal to the provided string.

    Let me know if I can provide any further assistance with this issue.

     

    Regards,

    Lyuba

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

     

     

Reply Children
No Data