how to find position # of a dock in a zone

2 posts, 0 answers
  1. Tanuj
    Tanuj avatar
    76 posts
    Member since:
    Aug 2012

    Posted 30 Apr 2008 Link to this post


    i am dynamically creating dock's in a single zone, the docks are dragable within the zone for repositioning, however after the respositioning is complete i want to find out the new positions in the zone.

    the user would be presented with this screen and their sequence is captured.

    please advise how can this be achieved..?

    here is a working example of what i am trying to achieve

    and here is the source code
    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 C21Online.Solution.DAL.App;  
    using Telerik.Web.UI;    
    public partial class MyListings_media_sequence : System.Web.UI.Page  
        protected void Page_Load(object sender, EventArgs e)  
            if (Request["tr_key"] != "")  
        private void BuildThePage(int tr_key)  
            DataSet PhotosDS = new DataSet();  
            PhotosDS = Listings.GetPhotosByListing(tr_key);  
            if (PhotosDS != null)  
                Image img;  
                for (int i = 0; i < PhotosDS.Tables[0].Rows.Count; i++)  
                    imgnew Image();  
                    img.CssClass = "thumbnail";   
                    img.ID = "thumbnail_" + i.ToString();  
                    img.ImageUrl = PhotosDS.Tables[0].Rows[i]["URL"].ToString().Trim();  
                    img.Width = Unit.Pixel(100);  
                    img.Height = Unit.Pixel(80);  
                    img.ToolTip = PhotosDS.Tables[0].Rows[i]["Title"].ToString().Trim();   
                    RadDock rd = new RadDock();  
                    rd.ID = "DockPhoto_" + i.ToString();  
                    rd.DockMode = DockMode.Docked;  
                    rd.Title = (i+1).ToString();  
                    rd.DockHandle = DockHandle.TitleBar;     
                    rd.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None;        
                    rd.Width = Unit.Pixel(120);  
                    rd.Height = Unit.Pixel(120);  

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="media_sequence.aspx.cs" Inherits="MyListings_media_sequence" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> 
    <html xmlns="" > 
    <head runat="server">  
        <title>Photo Sequence</title> 
        <LINK href="~/css/sitestyles.css" type="text/css" rel="stylesheet">  
        <script language="javascript" type="text/javascript" src="~/JS/main.js"></script> 
        <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server" > 
            <table cellpadding="0" cellspacing="0" border="0">  
                    <td><img src="~/Images/Misc/spacer.gif" border="0" alt="" width="5" /></td>  
                    <td style="vertical-align:top;">  
                    <telerik:RadDockLayout ID="RadDockLayout1" runat="server" Skin="Default" > 
                        <telerik:RadDockZone runat="server" id="RadDockZoneHorizontal1" orientation="Horizontal" 
                            BackColor="#8d8d8d" height="250px" width="650px">  
                            <asp:PlaceHolder runat="server" id="phPhotos"></asp:PlaceHolder> 
                    <td><img src="~/Images/Misc/spacer.gif" border="0" alt="" width="5" /></td>  

  2. Dimcho
    Dimcho avatar
    45 posts

    Posted 07 May 2008 Link to this post

    Hello Tanuj,

    We have already replied your other ticket on the issue. For your convenience, I will paste the reply here:

    I suggest you review our online demo Dynamically Created Docks and the help article Dynamically Creating RadDock Controls which describes how you can dynamically create docks and save their states in a storage medium such as a cookie or database. The RadDockLayout's server-side events SaveDockLayout and LoadDockLayout allow you to easily achieve this functionality. These events receive as an argument a DockLayoutEventArgs object which has two properties - DockZoneID and Index.The Index property is the position of the RadDock control in the docking zone.
    If you want to add a content inside a dynamically created dock you should do this in the function which creates the dock. Please look at the following example:

    private RadDock CreateRadDock()  
       RadDock dock = new RadDock();  
       System.Web.UI.WebControls.Image picture = new System.Web.UI.WebControls.Image();  
       picture.ImageUrl = "~/Images/images.jpg";  

    All the best,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top