This is a migrated thread and some comments may be shown as answers.

How to set RadPanelBarItem properties when data binding?

4 Answers 184 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Richard H
Top achievements
Rank 1
Richard H asked on 05 Apr 2009, 01:45 AM
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 http://demos.telerik.com/silverlight/default.aspx#PanelBar/DataBinding 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

4 Answers, 1 is accepted

Sort by
0
Accepted
Kaloyan
Telerik team
answered on 06 Apr 2009, 11:32 AM
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,
Kaloyan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Richard H
Top achievements
Rank 1
answered on 06 Apr 2009, 04:34 PM
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!

Cheers!
0
Preethi Gracia
Top achievements
Rank 1
answered on 17 Aug 2009, 12:35 PM
Hello,
    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.
    
Thanks,
Preethi
0
Tihomir Petkov
Telerik team
answered on 17 Aug 2009, 02:08 PM
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?

Regards,
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.
Tags
PanelBar
Asked by
Richard H
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Richard H
Top achievements
Rank 1
Preethi Gracia
Top achievements
Rank 1
Tihomir Petkov
Telerik team
Share this question
or