Pb with state of RaPanel

4 posts, 0 answers
  1. Maveric
    Maveric avatar
    39 posts
    Member since:
    Apr 2007

    Posted 21 Apr 2008 Link to this post

    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





  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 22 Apr 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maveric
    Maveric avatar
    39 posts
    Member since:
    Apr 2007

    Posted 22 Apr 2008 Link to this post

    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 ?
  5. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 22 Apr 2008 Link to this post

    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
Back to Top