TelerikPanelBar Databinding/Templating to two different Lists

1 Answer 16 Views
PanelBar
Dominik
Top achievements
Rank 2
Iron
Iron
Dominik asked on 21 Sep 2022, 08:27 AM | edited on 21 Sep 2022, 09:15 AM

Hi.

I want to use the TelerikPanelBar with two different Datasources. For the Header, I have a List "Articles" and for the Content I have an object "ArticleDetails", that will be loaded "lazy" if someone opens the accordion.

I want to use also the HeaderTemplate and ContentTemplate Feature.

The Samples show only PanelBarItem within a list of PanelBarItems, but I need a total different Object in the Content Area. The Idea is to load a list of Articles, and then when a user clicks on a panel the Details of the Article will be loaded and displayed.

Thanks and Regards

Dominik

1 Answer, 1 is accepted

Sort by
0
Dominik
Top achievements
Rank 2
Iron
Iron
answered on 21 Sep 2022, 12:38 PM

I think, I must use an extra object to hold header and Content information.

    private class PanelBarItem
    {
        public int Id { get; set; }
        public string Season { get; set; } = null!;
        public string Name { get; set; } = null!;
        public List<ArticleDetailsDto> ArticleDetails { get; set; } = new List<ArticleDetailsDto>();
    }

 

 

Tags
PanelBar
Asked by
Dominik
Top achievements
Rank 2
Iron
Iron
Answers by
Dominik
Top achievements
Rank 2
Iron
Iron
Share this question
or