RadDockZone

2 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Feb 2014

    Posted 20 Aug 2014 Link to this post

    Hi, Is it possible to resize and position  RadDockZone using Javascript and retrieve those change to be saved server side?

    Kind Regard
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Aug 2014 in reply to David Link to this post

    Hi David,

    Please try to set the Width and Height of the RadDockZone from JavaScript and store that values in a HiddenFiled, then try to access the HiddenField value from the code behind as follows.

    ASPX:
    <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
        <table>
            <tr>
                <td style="vertical-align: top">
                    <telerik:RadDockZone ID="RadDockZone2" runat="server" Orientation="Vertical" Width="250px" MinHeight="400px">
                        <telerik:RadDock ID="RadDock1" runat="server" Title="Blogs">
                            <ContentTemplate>
                                Dock1
                            </ContentTemplate>
                        </telerik:RadDock>
                    </telerik:RadDockZone>
                </td>
            </tr>
        </table>
        <br />
    </telerik:RadDockLayout>
    <telerik:RadButton ID="rbtnGetSize" runat="server" Text="Get Size" OnClick="rbtnGetSize_Click">
    </telerik:RadButton>
    <asp:HiddenField ID="hiddenHeight" runat="server" />
    <asp:HiddenField ID="hiddenWidth" runat="server" />

    JavaScript:
    function pageLoad() {
        var dock = $find("<%=RadDockZone2.ClientID%>");
        dock._element.style.height = "100px";
        dock._element.style.width = "900px";
        document.getElementById("hiddenHeight").value = dock._element.style.height;
        document.getElementById("hiddenWidth").value = dock._element.style.width;
    }

    C#:
    protected void rbtnGetSize_Click(object sender, EventArgs e)
    {
        string width =hiddenWidth.Value;
        string height = hiddenHeight.Value;
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top