select item through code

2 posts, 0 answers
  1. Manish Agarwal
    Manish Agarwal avatar
    44 posts
    Member since:
    Sep 2009

    Posted 15 Dec 2009 Link to this post

    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 :



    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>(); }


    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 .

    Charu Pahuja

  2. Kiril Stanoev
    Kiril Stanoev avatar
    1512 posts

    Posted 17 Dec 2009 Link to this post

    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.

    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.
Back to Top