Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Dock / Content

Click for postback. Dock states will be preserved on postback.
 
Text property
 
 
For simple static texts you could use the designer to set the Text property
 
     
 
Text property
 
 
You could also use the code-behind to set the Text property:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur euismod metus et arcu. Donec at velit eu massa vulputate condimentum. Duis pulvinar rutrum lectus. In ligula. In vel quam id odio aliquam viverra. Nullam aliquet nulla ac lectus. Integer ullamcorper nunc vel risus. Donec leo diam, lacinia molestie, semper vel, molestie tempor, risus. Nulla lobortis, dui non scelerisque imperdiet, leo leo viverra est, ac convallis velit metus id pede. Quisque libero leo, accumsan et, placerat sed, viverra sit amet, justo. Morbi sed massa. Etiam nec purus. Phasellus dignissim, pede eu venenatis faucibus, felis lorem feugiat ligula, vitae bibendum sapien dolor sed enim. Aenean eget turpis vitae est molestie porttitor. Duis quis lorem. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
 
     
 
ContentTemplate
 
 
You can put text and controls in the ContentTemplate.
You can also directly access the inner controls fromthe code-behind and set their properties!
 
     
 
ContentContainer
 
 
You should always add the controls because it is not persisted in the ViewState.
<May 2024>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
 
     

  • Content

    There are three ways to customize the content of the RadDock controls

    • Create ContentTemplate - in design mode you can add controls to the ContentTemplate property and RadDock will automatically display them in run time. In addition, you could create a class which implements the ITemplate interface and then set its instance to the ContentTemplate property from the code-behind.
    • Add controls to the ContentContainer - this is the container control for the ContentTemplate. Instead of creating a class which implements ITemplate you could directly add controls to the ContentContainer.Controls collection. This is slightly easier to implement, but you cannot easily reuse the template in other controls.
    • Set the Text property - if the RadDock control should display only plain text, you could set this property, instead of adding controls to the ContentTemplate or the ContentContainer.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Dock.Content.DefaultCS"
        CodeFile="DefaultCS.aspx.cs" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server" />
        <!--[if lte IE 6]>
        <style type="text/css">
        .raddockzone{width:230px;height:100px}
        </style>
        <![endif]-->
    </head>
    <body class="BODY">
        <form id="Form1" method="post" runat="server">
        <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
        <telerik:RadScriptManager ID="ScriptManager" runat="server" />
        <qsf:InformationBox ID="InformationBox1" runat="server">
            Click for postback. Dock states will be preserved on postback.
            <asp:Button runat="server" ID="Button1" Text="Postback" style="float:right"/>
        </qsf:InformationBox>
        <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
            <telerik:RadDockZone runat="server" ID="RadDockZone1" Style="float: left; margin-right: 70px;
                background: #f5f4e8;" Width="230" MinHeight="500">
                <telerik:RadDock runat="server" ID="RadDock1" Title="Text property" Text="For simple static texts you could use the designer to set the Text property">
                </telerik:RadDock>
                <telerik:RadDock runat="server" ID="RadDock2" Title="Text property">
                </telerik:RadDock>
            </telerik:RadDockZone>
            <telerik:RadDockZone runat="server" ID="RadDockZone2" Style="float: left; background: #d5f0fa;margin-right: 70px;"
                Width="230" MinHeight="500">
                <telerik:RadDock runat="server" ID="RadDock3" Title="ContentTemplate">
                    <ContentTemplate>
                        <div style="margin: 10px;">
                            <asp:Label runat="server" ID="Label1">You can put text and controls in the ContentTemplate.</asp:Label><br />
                            <asp:Label runat="server" ID="Label2"></asp:Label>
                        </div>
                        <div style="margin: 10px;">
                            <asp:Calendar runat="server" ID="calendar1"></asp:Calendar>
                        </div>
                    </ContentTemplate>
                </telerik:RadDock>
            </telerik:RadDockZone>
            <telerik:RadDockZone runat="server" ID="RadDockZone3" Style="float: left; background: #fff3c8;"
                Width="230" MinHeight="500">
                  <telerik:RadDock runat="server" ID="RadDock4" Title="ContentContainer">
                </telerik:RadDock>
            </telerik:RadDockZone>
        </telerik:RadDockLayout>
        <qsf:Footer runat="server" ID="Footer1" ShowCodeViewer="true" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451