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

how to active radwindow by radmenu ?

6 Answers 165 Views
Window
This is a migrated thread and some comments may be shown as answers.
lang dinh thien
Top achievements
Rank 1
lang dinh thien asked on 08 Sep 2009, 08:47 AM
hi team , shinu and anyone. sorry about this but i could not solve this problem.
i have a radmenu and it have an item KH and this item have 2 children HD and LH .they have 2 accesskey L and H for 2 children.i want when i active accesskey L , radwindow will show up. i can do it with a button by using property OpenerElementID but with item in radmenu they don't have property ID or Name to using property OpenerElementID.About event itemClick of radmenu to activating radwindow . because this event have a function in code behind so that i cann't wirte a function by javascript for it to activating radwindow. i have an idea to do it by using button ( when i click item in radmenu , they will active the action click like i click on button, but i don't know how to do that, running function button_click in function itemclick but nothing happened >.< ! may be this is stupid idea).  plz help me to solve that problem thank you all. ( i am just beginning with asp.net so that there is many thing i don't know ^.^).

6 Answers, 1 is accepted

Sort by
0
Casey
Top achievements
Rank 1
answered on 08 Sep 2009, 01:02 PM
To open RadWindows from my RadMenu I have a method called in the OnItemClick event of the RadMenu. In the method I set the text of an empty label equal to a javascript function so the javascript is called after the RadMenu ItemClick. I am using something similar to the below code:

<telerik:RadMenu ID="RadMenu2" Runat="server" onitemclick="RadMenu2_ItemClick"


protected void RadMenu2_ItemClick(object sender, RadMenuEventArgs e)  
{  
     if (e.Item.Text.ToString() == "Your RadMenu Item")  
       {  
            Label1.Text = "<script>Sys.Application.add_load(Your_JavaScript_Functions_Name);</script>";  
       }  

function Your_Javascript_Function() {  
                var oWindow = radopen("YourRadWindow.aspx""RadWindow1");  
0
Casey
Top achievements
Rank 1
answered on 08 Sep 2009, 01:02 PM
Not sure why, but it posted twice. Since I couldn't delete one of the posts I just editted and removed what I said so duplicate posts did not exist.
0
lang dinh thien
Top achievements
Rank 1
answered on 08 Sep 2009, 01:20 PM
thank you for your help . i can apply this solution for my problem. ^.^.
0
lang dinh thien
Top achievements
Rank 1
answered on 09 Sep 2009, 01:57 PM
Casey . i apply your code in my project but it doesn't work ??? plz help me another way .
0
Casey
Top achievements
Rank 1
answered on 09 Sep 2009, 02:04 PM
Hi lang,

When you say it doesn't work, what exactly do you mean? Are you getting an error, is the method not getting called on the "onitemclick" event of the RadMenu or something else? Could you post your RadMenu definition, the method called by the "onitemclick" event and the RadWindowManager definition?

Thanks,
Casey
0
lang dinh thien
Top achievements
Rank 1
answered on 09 Sep 2009, 04:41 PM
hi Casey
i have an idea to do that but i don't know how to to that
i find that radmenu have an event "onclientitemclick" i will use this event to execute
radopen("Liet_ke_khach_hang.aspx", "RadWindow1");
but i don't know how to recognize the menu item i want to execute this. example i have item with text="LA" and in event onclientitemclick i will compare the text of item was clicked with "LA" if it's true i will execute radopen. could you help me to compare it .
thank you. casey

ADDITION : I HAVE SOLVED THIS PROBLEM . I FIND IT IN TELERIK DEMOS . BUT THANK YOU FOR YOUR HELP , THANK YOU SO MUCH. GOD BLESS FOR YOU
Tags
Window
Asked by
lang dinh thien
Top achievements
Rank 1
Answers by
Casey
Top achievements
Rank 1
lang dinh thien
Top achievements
Rank 1
Share this question
or