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

Unexpected Behavior embedding dockzone in ItemTemplate.

3 Answers 76 Views
Dock
This is a migrated thread and some comments may be shown as answers.
SungamRammah
Top achievements
Rank 1
SungamRammah asked on 22 Jun 2009, 06:59 AM
The page compiles and on the surface the zones work as expected, but the radDockZone inside the (RadPanelBar) item template shows up as RadDockZone1 <RADDOCKZONE> in the properties window and not like expected RadDockZone2 Telerik.Web.UI.RadDockZone.
Consequently it is not accessible from Code behind.

Is this a expected limitation?

Thanks,
/ Magnus.

Edit: Adding Aspx code. RadDockZone1 is not accessible from code behind.

<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    </telerik:RadAjaxManager> 
    <div> 
        Header 
        <asp:Button ID="Button1" runat="server" Text="Button" /> 
    </div> 
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server"
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%"
            <telerik:RadPane ID="RadPane1" runat="server"
                <telerik:RadPanelBar ID="RadPanelBar1" runat="server"
                    <Items> 
                        <telerik:RadPanelItem runat="server" Text="Templates"
                            <ItemTemplate> 
                            Templates  
                            </ItemTemplate> 
                        </telerik:RadPanelItem> 
                        <telerik:RadPanelItem runat="server" Text="Results"
                            <ItemTemplate> 
                                <telerik:RadDockZone ID="RadDockZone1" runat="server" Height="300px" Width="300px"
                                    <telerik:RadDock ID="RadDock1" runat="server" Width="300px"
                                        <ContentTemplate> 
                                            Results 
                                        </ContentTemplate> 
                                    </telerik:RadDock> 
                                </telerik:RadDockZone> 
                            </ItemTemplate> 
                        </telerik:RadPanelItem> 
                    </Items> 
                </telerik:RadPanelBar> 
            </telerik:RadPane> 
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" /> 
            <telerik:RadPane ID="RadPane2" runat="server"
                <telerik:RadDockZone ID="RadDockZone2" runat="server" Height="300px" Width="300px"
                    <telerik:RadDock ID="RadDock2" runat="server" Width="300px"
                        <ContentTemplate> 
                            Documents 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
    </telerik:RadDockLayout> 
    </form> 
</body> 

3 Answers, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 23 Jun 2009, 03:28 PM
Hi Magnus,

There is not any unexpected behavior. What is displayed on the Properties window depends whether the page is viewed in Design View or Source View.
  • Design View - RadDockZone2 is shown as Telerik.Web.UI.RadDockZone and Button1 is shown as System.Web.UI.WebControls.Button
  • Source View - RadDockZone2 sometimes is shown as <RADDOCKZONE> and sometimes as Telerik.Web.UI.RadDockZone. Button1 sometimes is shown as <BUTTON> and sometimes as System.Web.UI.WebControls.Button

I have attached screen shots that show the explained behavior. I think that this issue is related to the Visual Studio, and not to Telerik ASP.NET AJAX RadControls (or the Microsoft ASP.NET controls).

For accessing the RadDockZone from the Code behind make sure that you have declared: 
using Telerik.Web.UI; 


Sincerely,
Pero
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
SungamRammah
Top achievements
Rank 1
answered on 24 Jun 2009, 07:43 PM
Thank you for your input... I am starting to feel guilty now leaning on your support resources while still just evaluating the product. Still I can't keep from following up with some more details about the problem. I think I confused things and totally missed the point.

I made a composite of three screen shots, where we can see that I declare RadDockZone1 and RadDockZone2... they idd render correctly, but as the red wiggly line indicates I can only reference the RadDockZone2 but not the Zone that lies within the itemTemplate.

Screenshot Magnus Can't Compile

I hereby promise that this will be the last question before license :) promise!

/Magnus
0
Accepted
Pero
Telerik team
answered on 25 Jun 2009, 12:22 PM
Hi Magnus,


To get an instance to the RadDockZone1 (or Button2) you should get an instance to RadPanelItem

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; 
 
namespace UnexpectedBehabior221403 
    public partial class _Default : System.Web.UI.Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            RadDockZone zone = (RadDockZone)RadPanelBar1.FindItemByText("Results").FindControl("RadDockZone1"); 
            zone.Width = Unit.Pixel(1000); 
 
            Button button = (Button)RadPanelBar1.FindItemByText("Results").FindControl("Button2"); 
            button.Text = "BUTTON TEXT CHANGED"
        } 
    } 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="UnexpectedBehabior221403._Default" %> 
 
<%@ 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"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager" runat="server"
    </asp:ScriptManager> 
    <div> 
        Header 
        <asp:Button ID="Button1" runat="server" Text="Button" /> 
    </div> 
    <telerik:RadDockLayout ID="RadDockLayout1" runat="server"
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%"
            <telerik:RadPane ID="RadPane1" runat="server"
                <telerik:RadPanelBar ID="RadPanelBar1" runat="server"
                    <Items> 
                        <telerik:RadPanelItem runat="server" Text="Templates"
                            <ItemTemplate> 
                                Templates 
                            </ItemTemplate> 
                        </telerik:RadPanelItem> 
                        <telerik:RadPanelItem runat="server" Text="Results"
                            <ItemTemplate> 
                                <asp:Button ID="Button2" runat="server" Text="ButtonText" /> 
                                <telerik:RadDockZone ID="RadDockZone1" runat="server" Height="300px"
                                    <telerik:RadDock ID="RadDock1" runat="server" Width="300px"
                                        <ContentTemplate> 
                                            Results 
                                        </ContentTemplate> 
                                    </telerik:RadDock> 
                                </telerik:RadDockZone> 
                            </ItemTemplate> 
                        </telerik:RadPanelItem> 
                    </Items> 
                </telerik:RadPanelBar> 
            </telerik:RadPane> 
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" /> 
            <telerik:RadPane ID="RadPane2" runat="server"
                <telerik:RadDockZone ID="RadDockZone2" runat="server" Height="300px" Width="300px"
                    <telerik:RadDock ID="RadDock2" runat="server" Width="300px"
                        <ContentTemplate> 
                            Documents 
                        </ContentTemplate> 
                    </telerik:RadDock> 
                </telerik:RadDockZone> 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
    </telerik:RadDockLayout> 
    </form> 
</body> 
</html> 


You can see that the Width of the RadDockZone1 is changed to 1000px, by dragging the dock that is inside. Also the text of the button is changed from "ButtonText" to "BUTTON TEXT CHANGED".



Kind regards,
Pero
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Dock
Asked by
SungamRammah
Top achievements
Rank 1
Answers by
Pero
Telerik team
SungamRammah
Top achievements
Rank 1
Share this question
or