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

Pb with state of RaPanel

3 Answers 79 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Maveric
Top achievements
Rank 2
Maveric asked on 21 Apr 2008, 03:05 PM
I don't understand, the PersistStateInCookie property didn't work,
that didn't restore the state.
It work perfect with Radcontrols for asp.net, I didn't change anything on the code
here the code I use
<telerik:RadPanelBar ID="RpnNav" runat="server" DataSourceID="Smds"  
  Width="100%" Height="100%" CausesValidation="false" 
  PersistStateInCookie="true" ExpandMode="FullExpandedItem"
  <CollapseAnimation Type="InBounce" Duration="100"></CollapseAnimation> 
</telerik:RadPanelBar> 
I try to add in the databound of radpanelbar the example of code of the site to display the selected item but it always have the value of nothing.
    Private Sub RpnNav_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RpnNav.DataBound 
        Dim selectedItem As RadPanelItem = RpnNav.SelectedItem 
        If Not (selectedItem Is Nothing) Then 
            Label1.Text = [String].Format("This is the {0} page", selectedItem.Text) 
        End If 
    End Sub 


Anyone coulf help me ?

Thanks

Maveric





3 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 22 Apr 2008, 07:42 AM
Hello Maveric,

I suggest that you execute your code in the PreRender event of RadPanelBar. For an example:

Protected Sub RadPanelBar1_PreRender(ByVal sender As ObjectByVal e As EventArgs)  
            Dim selectedItem As RadPanelItem = RadPanelBar1.SelectedItem  
            If Not (selectedItem Is NothingThen 
                Label1.Text = [String].Format("This is the {0} page", selectedItem.Text)  
            End If 
        End Sub 

Hope this helps.

Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Maveric
Top achievements
Rank 2
answered on 22 Apr 2008, 08:49 AM
Hi Rosi,

I also tried in the preRender event but it doesn't work.
In your demo page :
http://www.telerik.com/DEMOS/ASPNET/Prometheus/PanelBar/Examples/Functionality/PersistStateInCookie/DefaultCS.aspx

you told that You can access the SelectedItem by subscribing to the PreRender (DataBound if you use declarative datasources) event.
and in my case I use declarative datasources no ?
0
Rosi
Telerik team
answered on 22 Apr 2008, 12:31 PM
Hello Maveric,

Yes, you are right.

I am sorry for the misunderstanding.

The problem is resolved in our latest internal build. Please open a support ticket and we will send it to you.

Your points have been updated.

Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
PanelBar
Asked by
Maveric
Top achievements
Rank 2
Answers by
Rosi
Telerik team
Maveric
Top achievements
Rank 2
Share this question
or