This is a migrated thread and some comments may be shown as answers.

ItemCreated Event not Working for Menu

3 Answers 50 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Emmanuel
Top achievements
Rank 1
Emmanuel asked on 15 Sep 2008, 04:58 PM
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.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Sep 2008, 07:59 AM
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.
0
Emmanuel
Top achievements
Rank 1
answered on 16 Sep 2008, 02:16 PM
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.
0
Shinu
Top achievements
Rank 2
answered on 17 Sep 2008, 07:41 AM
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.
Tags
Menu
Asked by
Emmanuel
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Emmanuel
Top achievements
Rank 1
Share this question
or