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

Problem with height 100% in RadImageEditor

1 Answer 110 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Alejandro
Top achievements
Rank 1
Alejandro asked on 09 Apr 2013, 05:31 PM
Hi,

I want to fit "RadImageEditor1" in "RadpaneMiddle", width is ok but height not work.

What i can do?

Here is my code:
<telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Width="100%" Orientation="Horizontal">
    <telerik:RadPane runat="server" ID="RadPaneTop" Height="20%">
        <div>top</div>
    </telerik:RadPane>
    <telerik:RadSplitBar runat="server" ID="RadSplitbar1" CollapseMode="Forward">
    </telerik:RadSplitBar>
    <telerik:RadPane runat="server" ID="RadpaneMiddle" Height="80%">
        <telerik:RadImageEditor ID="RadImageEditor1" runat="server"
                ImageUrl="/img/logo_multim_120x53.gif"
                Width="100%" Height="100%">
        </telerik:RadImageEditor>
    </telerik:RadPane>
    <telerik:RadSplitBar runat="server" ID="RadSplitbar2" CollapseMode="Forward">
    </telerik:RadSplitBar>
    <telerik:RadPane runat="server" ID="Radpane1" Height="20%">
        <div>bottom</div>
    </telerik:RadPane>
</telerik:RadSplitter>




Regards,

Milko Rivas

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 12 Apr 2013, 10:33 AM
Hi Alejandro,

This is an expected behavior of the ImageEditor, since it does not supports height in percentages. A way to achieve the desired scenario, you could take the current height of the ImageEditor's parent pane and set it to it on the Splitter's OnClientLaod event-handler:
<telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Width="100%"
    Orientation="Horizontal" OnClientLoad="OnClientLoad">
    ...
</telerik:RadSplitter>
<script type="text/javascript">
    function OnClientLoad(splitter, args) {
        var paneHeight = $find("RadpaneMiddle").get_element().scrollHeight;
        $find("RadImageEditor1").set_height(paneHeight - 14);
    }
</script>

Additionally, it is highly not recommended the total size of the RadPanes to exceed 100%. If you want the height of the Splitter to be resized, depending on its content, I would suggest you to review the following article: Initially Resize the RadSplitter according to its content

Regards,
Veselina Raykova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ImageEditor
Asked by
Alejandro
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or