how to active radwindow by radmenu ?

7 posts, 0 answers
  1. lang dinh thien
    lang  dinh thien avatar
    14 posts
    Member since:
    Aug 2009

    Posted 08 Sep 2009 Link to this post

    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 ^.^).
  2. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 08 Sep 2009 Link to this post

    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");  
  3. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 08 Sep 2009 Link to this post

    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.
  4. lang dinh thien
    lang  dinh thien avatar
    14 posts
    Member since:
    Aug 2009

    Posted 08 Sep 2009 Link to this post

    thank you for your help . i can apply this solution for my problem. ^.^.
  5. lang dinh thien
    lang  dinh thien avatar
    14 posts
    Member since:
    Aug 2009

    Posted 09 Sep 2009 Link to this post

    Casey . i apply your code in my project but it doesn't work ??? plz help me another way .
  6. Casey
    Casey avatar
    299 posts
    Member since:
    Jul 2009

    Posted 09 Sep 2009 Link to this post

    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
  7. lang dinh thien
    lang  dinh thien avatar
    14 posts
    Member since:
    Aug 2009

    Posted 09 Sep 2009 Link to this post

    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
Back to Top