Search code examples
vb.nettelerikradmenu

rad menu , check if item text exists


Using telerik and the radmenu, do you know how to check if the item exists by text

my menu contains the text "menu1"

If I use menu.FindItemByText("menu1").Enabled = False this will disable the button

BUT

If I use menu.FindItemByText("menuTEST").Enabled = False then I get an exception as this button does not exist.

How do I stop the error?

I tried this below but it say it cant return booloen

If menu.FindItemByText("menuTEST") then

'do this

End If

Solution

  • Try this:

    If Not(menu.FindItemByText("menuTEST") Is Nothing) then
    
        'do this
    
    End If