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

select item through code

1 Answer 64 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Manish Agarwal
Top achievements
Rank 1
Manish Agarwal asked on 15 Dec 2009, 09:01 AM
Hi
For RADPanelBar
"EngagementListingPanel_Selected"  this event is fired when i select any item in the expanded Node  of RADPanelBar.

I want to select an item through code .
I am using Hierarchical Data :

public

 

class Category //: TreeViewItem

 

{

 

public string Name { get; set; }

 

 

public List<Category> SubCategories { get; set; }

 

 

public object Source { get; set; }

 

 

public string ParentName { get; set; }

 

 

public Category()

 

{ SubCategories =

new List<Category>(); }

 

}
Here
I bind my RadPanelBar with List<Category>


and From Hierarchy i bind like :

 

 

 

<core:HierarchicalDataTemplate ItemsSource="{Binding SubCategories}"

 

 

ItemTemplate="{StaticResource SubCategoryTemplate}" >

 

 

 

where my Itemtemplate is again a HierarchicalData:

 

 

 

<core:HierarchicalDataTemplate x:Name="SubCategoryTemplate" ItemsSource="{Binding SubCategories}"></<core:HierarchicalDataTemplate >

 

 

 

In Subcategories we have two type:Questionnaire Level ()
and QuestionLevel

from ItemSource i am binding the Questionnaire Level and from ItemTemplate for QuestionLevel
So whenever i select RadPanelBarItem i get this for "Questionnaire Level"
I want to select manually the items at Question Level


Please Suggest how it can be done.
Please Reply ASAP .

Regards
Charu Pahuja

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 17 Dec 2009, 03:22 PM
Hello Manish,

Have you considered using ContainerBindings to programatically select items. The article talks about RadTreeView, but the approach can easily be applied to RadPanelBar, since both are hierarchical controls. Also I am attaching a sample project that demonstrates how to use RadPanelBar with hierarchical data and programatically selects an item from the data source. Have a look at it and let me know if it is of any help. Also if you find something unclear or you need further explanation, I'd be glad to assist you.

Regards,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
PanelBar
Asked by
Manish Agarwal
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or