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

Removing or Disabling a Panel Item

3 Answers 33 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
RW
Top achievements
Rank 1
RW asked on 02 Dec 2008, 02:59 PM
Hi I am using a Panel bar that is being populated from a db, and I want to be able to disable or remove an item on page load.

I am using the following code, but it does not seem to do anything.
I tried using an onclick event instead and that worked, is there something wrong with my code?

Sub

 

Page_Load()

 

 

If Not (Page.IsPostBack) Then

 

 

Dim item As RadPanelItem = RadPanelBar1.FindItemByText("Forum")

 

item.Owner.Items.Remove(item)

End

 

If

 

 

End Sub

Any help would be greatly appreciated.

Jason

 

3 Answers, 1 is accepted

Sort by
0
RW
Top achievements
Rank 1
answered on 03 Dec 2008, 07:30 PM
Anyone?
0
Accepted
Paul
Telerik team
answered on 04 Dec 2008, 12:22 PM
Hi Jason,

Please move your code from Page_Load event to panelbar's PreRender. Let us know how it goes.

Kind regards,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
RW
Top achievements
Rank 1
answered on 04 Dec 2008, 02:57 PM
Thanks Paul!!
Tags
PanelBar
Asked by
RW
Top achievements
Rank 1
Answers by
RW
Top achievements
Rank 1
Paul
Telerik team
Share this question
or