How to set RadPanelBarItem properties when data binding?

5 posts, 1 answers
  1. Richard H
    Richard H avatar
    18 posts
    Member since:
    May 2006

    Posted 04 Apr 2009 Link to this post

    Hi There,

    I have a question about how you would set properties (like IsExpanded, IsSelected, IsEnabled, etc...) of the RadPanelBarItem using dynamic data from the item binding source when you are performing hierarchical data binding to a RadPanelBar (or even TreeView) control?

    I have reviewed the "TreeView / Hierarchical Template" and "PanelBar / Data Binding" demo samples at but they don't demonstrate the functionality I am after.

    An example of what I would like to accomplish would be to data bind the IsExpanded & IsSelected properties of the RadPanelBarItem to data from my binding source so that when the RadPanelBar loads, one or more of the RadPanelBarItems are shown in an expanded/selected state automatically based on properties of my business object. I have included a example of what I would like the RadPanelBar to look like once data binding completes:

      Mail (Expanded and Selected by default)  
        - Personal Folders  
        - Deleted Items   
        - Inbox (Selected by default)  
        - etc...  
      Contacts (Not expanded)  
      Tasks (Not expanded)  
      Notes (Not expanded) 

    I can't seem to find a way to do this through data binding but I must be missing something. What is the best way to accomplish this?

    Any help would be greatly appreciated.

    Thanks, Richard
  2. Answer
    Kaloyan avatar
    920 posts

    Posted 06 Apr 2009 Link to this post

    Hi RH,

    Thank you for using our controls.

    The task you want to achieve is pretty common. Unfortunately, Silverlight 2  does not support relative source(element name) binding. The feature will be supported with Silverlight 3 that is currently in a Beta stage. Hence, I will suggest that you use the Telerik.Windows.Controls.ContainerBinding class which provides a similar functionalities. I am attaching a simple project demonstrating the way you can achieve the desired result.

    Best wishes,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Richard H
    Richard H avatar
    18 posts
    Member since:
    May 2006

    Posted 06 Apr 2009 Link to this post

    Perfect, that looks to be just what I am looking for. I plan to switch to Silverlight 3 ASAP, but am waiting until it officially releases. Thanks for putting together the sample app!

  4. Preethi Gracia
    Preethi Gracia avatar
    6 posts
    Member since:
    Jul 2009

    Posted 17 Aug 2009 Link to this post

        I would like to add "RadHtmlPlaceholder" control to display internet content as radPanelItem of PanelBar. I downloaded the bindingpanelbar.rar given with this thread, I was able to add the Base Items. But the the items within these are not merely text. I need to add a RadHtmlPlaceHolder. I need something like this, there need to be three baseItems namely Mail,chat and task. I need to display radhtmlplaceholder under each of them, to display google,yahoo and gmail respectively. Any suggestions. Please help me with a sample.I am using Silverlight version 2 and RadControls for Silverlight Q2 2009.
  5. Tihomir Petkov
    Tihomir Petkov avatar
    576 posts

    Posted 17 Aug 2009 Link to this post

    Hello Preethi,

    With our 2009 Q2 SP1 release we officially ended the support for Silverlight 2. Is there any specific reason why you are using old version of the runtime?

    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top