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

How to set Skin property for dynamic created RadDock

5 Answers 194 Views
Dock
This is a migrated thread and some comments may be shown as answers.
madhu
Top achievements
Rank 1
madhu asked on 25 Jun 2007, 10:33 PM
Hi
I am creating the whole page dynamic, with Zones , RadDocks all dynamic.
I want to set the Skin property for RadDocks.
How to set the Skin Property for dynamically created RadDocks.
Can anyone help?
Thank you.

5 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 27 Jun 2007, 07:15 AM

Hello Madhu,

A RadDock skin example can be found here.
Simple source code showing how to dynamically set the skin you can find below:

ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="pages_Dock_Tickets_DifferentSkins_Default" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head id="Head1" runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div> 
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server" > 
        <telerik:RadDockZone ID="RadDockZone1" runat="server" Width="300px" Height="400px" 
        Orientation="Vertical" FitDocks="true" Skin="Default" 
        > 
        </telerik:RadDockZone> 
    </telerik:RadDockLayout> 
    <asp:Button ID="Button1" runat="server" /> 
    </div> 
    </form> 
</body> 

Codebehind:
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using Telerik.Web.UI;  
 
public partial class pages_Dock_Tickets_DifferentSkins_Default : System.Web.UI.Page  
{  
    protected override void OnInit(EventArgs e)  
    {  
        base.OnInit(e);  
        RadDock dock1 = new RadDock();  
        dock1.Title = dock1.ID = "dock1";  
        dock1.Skin = "Longhorn";  
        RadDockZone1.Controls.Add(dock1);  
          
        RadDock dock2 = new RadDock();  
        dock2.Title = dock2.ID = "dock2";  
        dock2.Skin = "Outlook";  
        RadDockZone1.Controls.Add(dock2);  
    }  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        
    }  
}  
 


To use a custom CSS skin file, you need to disable the built-in CSS skin files by setting EnableEmbeddedSkins property to false. If you set it to the RadDockLayout control, all inner RadDock and RadDockZone controls will inherit the setting. The same applies to the Skin property. The third step is to manually register the CSS file for your custom skin in the page's HEAD tag.

The following example demonstrates the described technique:
http://www.telerik.com/demos/aspnet/prometheus/Dock/Examples/PostIt/DefaultCS.aspx
Also you can find more in our help.

If you have any other questions please let us know!



All the best,
Petio Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
madhu
Top achievements
Rank 1
answered on 27 Jun 2007, 02:09 PM
Hi
Thank you for Reply.
But in the reply given you have used the RadDockLayout and RadDockZone in design time and inserting to the static RadDockZone.
But in my application, i don't have any static RadDockLayout or any RadDockZones.
I have static RadTabStrip and static RadMultiPage .
All the Tabs, Pageviews, Zones ,RAdDocks are created dynamically.
So since all are dynamic I am not able to set the Skin for RadDocks.
Do you have any solution for this.
Thank you.
0
Valeri Hristov
Telerik team
answered on 27 Jun 2007, 03:38 PM
Hi madhu,

Did you try to set the Skin property of RadDockLayout, or RadDockZone/RadDock from the code behind, where you create them?

Sincerely yours,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
madhu
Top achievements
Rank 1
answered on 27 Jun 2007, 11:11 PM
Hi
I did try setting the Skin property for dynamically created RadDockZone and RAdDock.

I did not create RadDockLayout.
But for the RadMultiPage, I created PageView dynamic, then RadSplitter, RadPAne, RadDockZone and RAdDock all are created dynamically.
I set the Skin property for RadDockZone and RAdDock at codebehind as
RadDockZone zone=new RadDockZone();
zone.Skin="Telerik";
RadDock dock=new RadDock();
dock.Skin="Telerik";
zone.Controls.Add(dock);

But we did not get the skin we wanted.
Can you help us?
Thank you.

0
Petio Petkov
Telerik team
answered on 28 Jun 2007, 09:44 AM

Hi Madhu,

The following code illustrates how to add dynamically RadDocks with different skins:

ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="pages_Dock_Tickets_DifferentSkins_Default" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head id="Head1" runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
    <div> 
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server" > 
        <telerik:RadDockZone ID="RadDockZone1" runat="server"  Orientation="Vertical" FitDocks="true">  
        </telerik:RadDockZone> 
    </telerik:RadDockLayout> 
    <asp:Button ID="Button1" runat="server" /> 
    </div> 
    </form> 
</body> 

CodeBehind:
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using Telerik.Web.UI;  
 
public partial class pages_Dock_Tickets_DifferentSkins_Default : System.Web.UI.Page  
{  
    protected override void OnInit(EventArgs e)  
    {  
        base.OnInit(e);  
        RadDock dock1 = new RadDock();  
        dock1.Title = dock1.ID = "dock1";  
        dock1.Skin = "Longhorn";  
        RadDockZone1.Controls.Add(dock1);  
          
        RadDock dock2 = new RadDock();  
        dock2.Title = dock2.ID = "dock2";  
        dock2.Skin = "Outlook";  
        RadDockZone1.Controls.Add(dock2);  
    }  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        
    }  
}  
 


If you use AJAX you must  manually register the CSS file for your skin in the page's HEAD tag. For example:

<head id="Head1" runat="server">  
    <qsf:headtag id="Headtag1" runat="server" /> 
    <link rel="stylesheet" href="Skins/Telerik/Dock.Telerik.css" type="text/css" /> 
</head> 
 

If you continue to experience this problem, please open a new support ticket and send us a simple running project where this issue could be observed.

Kind Regards,
Petio Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
madhu
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
madhu
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or