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

get_selectedItem() is null??

1 Answer 89 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 01 Apr 2009, 05:33 AM

I am trying to get the selected item of the PanelBar but I always get null. Can any one help me? Greatly appreciated.

 

--------------My Code-------------------------------------------
//Getting PanelBar1 inside custom control called "folderExplorer"

 

var panelbar1 = <%=((RadPanelBar)folderExplorer.FindControl("PanelBar1")).ClientID %>;

 

 

//panelbar1 object is okay but I am not able to get any selected items

 

 

var myitem = panelbar1.get_selectedItem();

 

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 06 Apr 2009, 12:48 PM
Hello Frank,

It seems the currently selected item is down in the hierarchy, thus the issue. In order to achieve your goal you will have to first expand the root items in code-behind, i.e.

protected void Page_Load(object sender, EventArgs e)  
    {  
        RadPanelBar1.SelectedItem.ExpandParentItems();  
    } 

Sincerely yours,
Paul
the Telerik team

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