Forums

ASPxMenu and Panels

Last post 9/11/2008 8:46 AM by Vic S (DevExpress). 4 replies.
Sort Posts: Previous Next
  • Reza Mohamed

    ASPxMenu and Panels

    9/6/2008 5:54 PM
    • Top 500 Contributor
    • Joined on 8/28/2008
    • Dallas, TX
    • Posts 70

    I have a couple of questions, in teh ASPxMenu item, how do I disable the top level items from being clickable? I just want to do stuff when the children are clicked.

    Also, can some guide me how to accomplish this:

    I have a ASPxMenu item and based on the item that i have clicked, I want to display different tasks in a panel below without a page refresh. So basically, there should be a panel below that appears only on click of an item. And each item corresponds to different things that would be shown on the panel.

    I believe there should be a CallbackPanel somwhere, but I couldnt figure out how to get it to work.

    Also, can I have multiple panels and enable them, disable them as needed? How would I accomplish this? I have the following code so far:

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    <dxrp:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="100%"

     

     

    ShowHeader

    ="False">

     

     

    <PanelCollection

    >

     

     

    <dxp:PanelContent runat

    ="server">

     

     

    <dxcp:ASPxCallbackPanel ID="ASPxCallbackPanel1" runat="server" Width

    ="200px">

     

     

    <PanelCollection

    >

     

     

    <dxp:PanelContent ID="AddUser" runat

    ="server">

     

     

     

    <dxe:ASPxLabel ID="ASPxLabel1" runat="server" Text

    ="Users">

     

     

    </dxe:ASPxLabel

    >

     

     

    </dxp:PanelContent

    >

     

     

    </PanelCollection

    >

     

     

    </dxcp:ASPxCallbackPanel

    >

     

     

    </dxp:PanelContent

    >

     

     

    </PanelCollection

    >

     

     

    </dxrp:ASPxRoundPanel

    >

  • Ramy Othman

    Re: ASPxMenu and Panels

    9/10/2008 6:17 AM
    • Top 500 Contributor
    • Joined on 10/23/2009
    • Posts 73

    Hi,

    First you need to set the property of the ASPxMenu-> AllowSelectItem = True

    and place a ASPxCallBackPanel and give it a clientinstance name for example cpanel then place all the round panels you want to put inside this callback panel and make their visible property = false

    then in the ASPxMenu Event of Item Click place this line 

    //This line call the cpanel call back and pass to it a parameter the text of the clicked item

    cpanel.PerformCallback(s.GetSelectedItem().GetText());

    Then in the event of the  Callback of the Panel

      Protected Sub ASPxCallbackPanel1_Callback(ByVal source As Object, ByVal e As DevExpress.Web.ASPxClasses.CallbackEventArgsBase) Handles ASPxCallbackPanel1.Callback

    if(e.Parameter = "SOANDSO") Then

    display  rount panel 1 // set visible for round panel1 to true

    Else if (e.Parameter = "SoANdSo2") Then

    display round panel 2 // set visible for round panel2 to true

    End If

        End Sub

     

    Regards

    Ramy Mostafa

  • Reza Mohamed

    Re: ASPxMenu and Panels

    9/10/2008 12:55 PM
    • Top 500 Contributor
    • Joined on 8/28/2008
    • Dallas, TX
    • Posts 70

     How do you disable the Menu root level items from being clickable?

  • Ramy Othman

    Re: ASPxMenu and Panels

    9/11/2008 3:54 AM
    • Top 500 Contributor
    • Joined on 10/23/2009
    • Posts 73

    Hi,

    In the client side event ItemClick put the following condition

    //if its an empty string this means its a root element

    if(s.GetSelectedItem().parent.GetText() != "")

    {

    cpanel.PerformCallback(s.GetSelectedItem().GetText());

    }

    Regards

    Ramy Mostafa

  • Vic S (DevExpress)

    Re: ASPxMenu and Panels

    9/11/2008 8:46 AM
    • Top 150 Contributor
    • Joined on 5/14/2007
    • Posts 124

    Hello!
    You can take a look at the following thread to find some sample code:

    http://community.devexpress.com/forums/p/60542/204939.aspx#204939

    Thanks,
    Vic

    R&D, DevExpress
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.