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

Dynamically remove border of RadDock

1 Answer 167 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Farshad heidary
Top achievements
Rank 1
Farshad heidary asked on 27 May 2010, 08:17 PM
hi.
How i can dynamicaly Remove boirder of rad dock
i use this code but is not answer!
  dock.BorderStyle = BorderStyle.None;
            dock.BorderWidth = 0;
            dock.BorderColor = System.Drawing.Color.Transparent;

1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 02 Jun 2010, 01:32 PM
Hello Farshad,

The borders of a given dock cannot be disabled by setting the properties related to the border style. This can  be done using custom CSS. Here is an example:

.aspx
<%@ 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">
    <title></title>
    <style id="dockStyles" runat="server" type="text/css">
        div.RadDock.rdCollapsed
        {
            height: 25px !important;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        </Scripts>
    </asp:ScriptManager>
    <div>
        <telerik:RadDockLayout ID="RadDockLayout1" runat="server">
            <telerik:RadDockZone ID="RadDockZone1" runat="server" MinHeight="300px" Width="300px">
                <telerik:RadDock ID="RadDock1" runat="server" Title="RadDock-Title" Width="300px">
                    <ContentTemplate>
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        CONTENT
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                    </ContentTemplate>
                </telerik:RadDock>
                <telerik:RadDock ID="RadDock2" runat="server" Title="RadDock-Title" Width="300px">
                    <ContentTemplate>
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        CONTENT
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                    </ContentTemplate>
                </telerik:RadDock>
            </telerik:RadDockZone>
        </telerik:RadDockLayout>
    </div>
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Web.Caching;
 
public partial class Default_Dock : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        DisableBorders(RadDock1);
    }
 
    /// <summary>
    /// Disables the borders of a given dock.
    /// </summary>
    /// <param name="dock">The dock to which the borders will be disabled.</param>
    void DisableBorders(RadDock dock)
    {
        string dockID = "#" + dock.ClientID;
        LiteralControl ltrl = new LiteralControl();
        ltrl.ID = "CSS";
        ltrl.Text = dockID + " .rdMiddle .rdLeft," + dockID + " .rdMiddle .rdRight," + dockID
            + " .rdBottom .rdLeft," + dockID + " .rdBottom .rdRight," + dockID + " .rdBottom .rdCenter,"
            + dockID + " .rdTop .rdLeft," + dockID + " .rdTop .rdRight" + "{display: none !important;} ";
        ltrl.Text += dockID + " .rdTop .rdCenter {background-position: 0 -28px !important;} ";
        ltrl.Text += dockID + " .rdTop .rdCenter," + dockID + " .rdTop .rdLeft," + dockID + " .rdTop .rdRight{height: 25px !important;} ";
        ltrl.Text += dockID + " .rdTitleBar EM{font: 12px/25px 'Segoe UI' , Arial, Sans-serif !important;   padding-left: 5px !important;}";
 
        dockStyles.Controls.Add(ltrl);
    }
}


The highlighted code is needed to disable the borders.

Regards,
Pero
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.
Tags
Dock
Asked by
Farshad heidary
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or