ItemCreated Event not Working for Menu

4 posts, 0 answers
  1. Emmanuel
    Emmanuel  avatar
    4 posts
    Member since:
    Sep 2008

    Posted 15 Sep 2008 Link to this post

    Hello,

    First of all i want to say this is the greatest ASP.NET component on earth.

    I created a menu at design but  discovered that I cannot access the ItemClient event of the radMenu. I was able to access same menu when I created it with server-side code. Is there another way to access menuCreated event after creating the menu in design time. I need to decided whether to enable/disable a menuItem.

    Creating all my menu at design time will be very tedious for me.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Sep 2008 Link to this post

    Hi Emmanuel,

    I was also able to replicate the same sceanario when i tried creating RadMenu with the inline description(adding radmenu items from the aspx). I think you have to either create the radmenu dynamically or bind the radmenu with DataSource to fire the ItemCreated event. I also found the following help article which explains more on  RadMenu's ItemCreated event.
    ItemCreated

    Shinu.
  3. Emmanuel
    Emmanuel  avatar
    4 posts
    Member since:
    Sep 2008

    Posted 16 Sep 2008 Link to this post

    Sorry, I did a very horrible job with my typos. this is what I meant

    I need to disable some menuItem before user have access to using it. From the radMenu documentation, i understand i can do this with the itemCreated event method. I created a radmenu and series of menuItems and tried accessing the method (itemCreated) and discovered that the method is not executed at all when your menu is created at design time. I created the same menu using the server-side code and was able to access the itemCreated Method.

    Is where a way i can access the itemCreated method after designing my memuItems in the design window. I want to be able to dynamically disable or hide some menu item  for some users in my apps withoud having to hard code all the menuItems on the server-side.

    NB.
    Thanks Shinu for your input I appreciate it.
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Sep 2008 Link to this post

    Hi Emmanuel,

    One another suggestion will be to disable/hide the menu item in the PreRender event of RadMenu as shown below.

    CS:
     protected void RadMenu1_PreRender(object sender, EventArgs e) 
        { 
            foreach (RadMenuItem item in RadMenu1.Items) 
            {  
             if(item.Text=="Productname") 
             { 
                 item.Enabled = false
             } 
            } 
        } 


    Thanks
    Shinu.
Back to Top