why skin don't save

2 posts, 0 answers
  1. HL
    HL avatar
    55 posts
    Member since:
    Dec 2009

    Posted 05 May 2010 Link to this post

    hi all:
       I added dock dynamically to the three zones.I set up different skin for each Zone. After user log back in and reloaded the docks which  have been saved, the skin setting doesn't work.  how could I fix this issue?

    what I need is that every dock in the same zone have the same color. I also wonder how could I set up each dock has it own title bar color?



     <telerik:RadDockLayout runat="server" ID="RadDockLayout1"   
                     <table style="width:100%" border="0" > 
                     <tr > 
                      <td style="width:30%">  
                         <telerik:RadDockZone runat="server" ID="RadDockZone1" Height="100%"   
                           FitDocks="true" Width="100%" MinHeight="0" BorderWidth="0" Orientation="Vertical" Skin="Outlook">  
                      <td style="width:30%" > 
                           <telerik:RadDockZone runat="server" ID="RadDockZone2" Height="100%"   
                               Style="_height:100%;border-color:lightgray;float:  right; margin-right: 0px"   
                               Orientation="Vertical" FitDocks="true" Skin="WebBlue">  
                       <td style="width:30%">  
                           <telerik:RadDockZone runat="server" ID="RadDockZone3" Height="100%"   
                               Width="100%"  Style="_height:100%;border-color:lightgray;float: right; margin-right: 0px"   
                               Orientation="Vertical" FitDocks="true" Skin="Vista">  
    vb.net codes:  
     Private Sub CreateDefaultRadDock()  
            Dim index As Integer  
            Dim DockList As New ArrayList()  
            Dim intCount As Integer = 0 
            Dim intReminder As Integer  
            Dim dock As RadDock  
            If Not Me.chkWidgetList.Items Is Nothing Then  
                intCount = Me.chkWidgetList.Items.Count  
            End If  
            For index = 0 To intCount - 1  
                dock = CreateRadDock(chkWidgetList.Items(index).Text)  
                intReminder = index Mod 3  
                Select Case intReminder  
                    Case 0  
                        dock.Skin = "Web20" 
                    Case 1  
                        dock.Skin = "Vista" 
                    Case 2  
                        dock.Skin = "Outlook" 
                End Select  
                Me.chkWidgetList.Items(index).Selected = True 
                'We want to save the dock state every time a dock is moved.         
                'Load the selected widget         
                dock.Tag = WidgetFolder + "/" + chkWidgetList.Items(index).Value  
            Next index  
            Me.btnAdd.Enabled = False 
            Me.btnReset.Enabled = False 
            'don't need to reload Dock   
            isNeedReload = False 
        End Sub  
  2. Petio Petkov
    Petio Petkov avatar
    825 posts

    Posted 06 May 2010 Link to this post


    The code below shows a simple example which illustrates how to change RadDock's skins depending on the parent RadDockZone:

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head id="Head1" runat="server">
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
                <table style="width:100%" border="0" >  
                     <tr >  
                      <td style="width:30%">   
                         <telerik:RadDockZone runat="server" ID="RadDockZone1" Height="100%"    
                           FitDocks="true" Width="100%" MinHeight="0" BorderWidth="0" Orientation="Vertical" Skin="Outlook">   
                      <td style="width:30%" >  
                           <telerik:RadDockZone runat="server" ID="RadDockZone2" Height="100%"    
                               Style="_height:100%;border-color:lightgray;float:  right; margin-right: 0px"    
                               Orientation="Vertical" FitDocks="true" Skin="WebBlue">   
                       <td style="width:30%">   
                           <telerik:RadDockZone runat="server" ID="RadDockZone3" Height="100%"    
                               Width="100%"  Style="_height:100%;border-color:lightgray;float: right; margin-right: 0px"    
                               Orientation="Vertical" FitDocks="true" Skin="Vista">   
            <asp:Button ID="Button1" runat="server" Text="Postback"/>
    Protected Overrides Sub OnInit(ByVal e As EventArgs)
        Dim dock As RadDock = CreateRadDock("RadDock1")
        dock = CreateRadDock("RadDock2")
        dock = CreateRadDock("RadDock3")
    End Sub
    Protected Function CreateRadDock(ByVal ID As String) As RadDock
        Dim dock As New RadDock()
        dock.ID = ID
        dock.Title = ID
        dock.UniqueName = ID
        dock.AutoPostBack = True
        Return dock
    End Function
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    End Sub
    Protected Sub ChangeSkinDependingOnParentZone()
        For Each dock As RadDock In RadDockLayout1.RegisteredDocks
            Dim dockZoneId As String = dock.DockZoneID
            Select Case dockZoneId
                Case "RadDockZone1"
                    dock.Skin = "Outlook"
                    Exit Select
                Case "RadDockZone2"
                    dock.Skin = "WebBlue"
                    Exit Select
                Case "RadDockZone3"
                    dock.Skin = "Vista"
                    Exit Select
                Case Else
                    dock.Skin = "Default"
                    Exit Select
            End Select
    End Sub

    If you want to modify the TitleBar, my suggestion is to use TitlebarTemplate as is shown in the following example:


    Let us know how it goes and in case you need further assistance.

    All the best,
    Petio Petkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft R3 2016 release webinar banner
Back to Top