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

TreeViews nested in PanelBar

1 Answer 22 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 25 Aug 2008, 11:44 AM
Hi all

We have a PanelBar with some nested treeviews which are created programmatically, i.e. at runtime in the code behind. The items in the PanelBar are dynamically created as well. Unfortunately when a postback occurs, the TreeViews just disappear.
The code of Page_Load is basically:
     if (!IsPostBack)
            {
                BuildNavigation();
            }
The result of calling BuildNavigation() also in a postback would be that the PanelBarItems appear twice, so this is not the solution.

How can I make shure that the TreeViews are generated also in the postback?
Thank you!

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 27 Aug 2008, 01:27 PM
Hello Marc,

You need to create the treeviews in every page load. Since the items of the panelbar will duplicate you can first call:

RadPanelBar1.ClearSelectedItems();
RadPanelBar1.Items.Clear();

And then add the panelbar items.

Regards,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
PanelBar
Asked by
Marc
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or