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

RadDockZone

1 Answer 18 Views
Dock
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 20 Aug 2014, 03:25 PM
Hi, Is it possible to resize and position  RadDockZone using Javascript and retrieve those change to be saved server side?

Kind Regard

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 21 Aug 2014, 05:22 AM
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.
Tags
Dock
Asked by
David
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or