Full Expand & Readonly

5 posts, 0 answers
  1. bill
    bill avatar
    20 posts
    Member since:
    Sep 2008

    Posted 09 Apr 2010 Link to this post

    I would like my panel to always have every item expanded.  I would also like to prevent users from clicking on the panel.  I am binding the panel to a site map, and I want the user to be able to see where they're at in the wizard, but I don't want them to navigate via the panel.  Are there properties I can set to allow this?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Apr 2010 Link to this post

    Hello Bill,

    You can try the following code snippet in order to expand all the items.
    CS:
     
        protected void RadPanelBar1_PreRender(object sender, EventArgs e) 
        { 
            foreach(RadPanelItem item in RadPanelBar1.GetAllItems() ) 
            { 
                if (item.Items.Count>0) 
                { 
                    item.Expanded = true
                } 
            } 
        } 

    Attach the 'OnClientItemClicking' event to RadPanelBar and use the args.set_cancel(true) in order to cancel the event.
    JavaScript:
     
    <script type="text/javascript"
        function OnClientItemClicking(sender, args) { 
            args.set_cancel(true); 
        } 
    </script> 

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. bill
    bill avatar
    20 posts
    Member since:
    Sep 2008

    Posted 12 Apr 2010 Link to this post

    Thank you for your resopnse.  How would I attach the RadPanelBar to the javascript function?
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Apr 2010 Link to this post

    Hello Bill,

    You could simply assign the name of the javascript function as the value of the the corresponding RadPanelBar property.

    ASPX:
     
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" OnClientItemClicking="OnClientItemClicking" > 
     ... 
    </telerik:RadPanelBar> 

    Regards,
    Princy.
  6. bill
    bill avatar
    20 posts
    Member since:
    Sep 2008

    Posted 13 Apr 2010 Link to this post

     

    Thanks, I wasn't sure how to pass in the arguments, but it appears I didn't need to. This prevents the item from navigating on click, but when I hover over the control or click a new item, the style changes. I tried using the same script for OnClientMouseOver and OnClientItemClicked, with no luck.

    (sorry about the red text, I can't seem to find a way to change it)
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017