RadPanelBar Expand Behavior

7 posts, 1 answers
  1. Sergio Cortez
    Sergio Cortez avatar
    23 posts
    Member since:
    Nov 2008

    Posted 30 Mar 2009 Link to this post

    HI Everyone.
    I have been working with the RadPanelBar as the left Navigation Control Replacing the default ASP:Menu.

    Everything is working fine but i have a little doubt about the expand behavior of the RadPanelBar.

    Is there a way to click the arrow to make the expand animation go on and off   BUT  without redirecting the page.

    and unless the user clicks the header of the panelbar then go and redirect to the selected page.

    Thank very much i appreciate any help, tip or trick.


    Sergio
  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 31 Mar 2009 Link to this post

    Hello Sergio,

    Please refer to this KB article for details on the matter.

    Kind regards,
    Paul
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.

  3. Sergio Cortez
    Sergio Cortez avatar
    23 posts
    Member since:
    Nov 2008

    Posted 31 Mar 2009 Link to this post

    Hi Paul thank you very much for your help.
    i have red the article and its great its exactly what i want to do.
    But i have more question, sorry.

    The article sais that i need to is to modify  ImageUrl and ExpandedImageUrl Property in the RadPanelItem
    But the problem is that i am not defining any RadPanelItem for my PanelBar because im using a custom navigation provider wich build the entire PanelBar at runtime.

    So i only have this line
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" DataSourceID="MyNaviProvider"
     Skin="MySkin" EnableEmbeddedSkins="False" OnClientItemClicking="onClicking"  />
                                        

    What should i do?

    Thank you for the support
     
  4. Sergio Cortez
    Sergio Cortez avatar
    23 posts
    Member since:
    Nov 2008

    Posted 31 Mar 2009 Link to this post

    Hi Paul. I've been working with the radpanelbar and the examples that comes with the KB article.
    Right now i think im really near to get this thing do its work.

    I have a question , hope you can help me.

    what does exactly this IF do?

     if (target == eventArgs.get_item().get_imageElement())
    {
    }


    Appreciate your help
  5. Answer
    Paul
    Admin
    Paul avatar
    4281 posts

    Posted 01 Apr 2009 Link to this post

    Hello Sergio,

    This is needed for checking if the click comes from the RadPanelItem image (defined via the ImageUrl property).

    Sincerely yours,
    Paul
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. Sergio Cortez
    Sergio Cortez avatar
    23 posts
    Member since:
    Nov 2008

    Posted 01 Apr 2009 Link to this post

    Hi Paul. Me again :p
    Well as i need to set the ImageUrl Property to each item so the javascript code can work properly i decided to use the event OnItemDataBinding

    protected void RadPanel_OnItemDatabound(object sender, RadPanelBarEventArgs e)
        {
            if (e.Item.Items .Count >0)
            {
                e.Item.ImageUrl = "arrow-right.gif";
                e.Item.ExpandedImageUrl = "arrow-down.gif";
            }
        }

    but im running into problems because its placing an arrow to every element in the panelbar
    i have added this conditon if (e.Item.Items .Count >0) so it only places the image to items that has childs.

    sadly there is no property like e.Items.HasChildren()             :(
    Thanks




  7. Sergio Cortez
    Sergio Cortez avatar
    23 posts
    Member since:
    Nov 2008

    Posted 06 Apr 2009 Link to this post

    the answer is to use e.Item.Items .Count >0 but in the Databound event and not in the itemdatabound.

    thank you
Back to Top