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

Web User Control loaded with RadAjaxManager does not resize on page resize

4 Answers 64 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Lorenzo
Top achievements
Rank 1
Lorenzo asked on 23 Nov 2010, 05:00 PM
Hi,
I'm working on a project which is based on Web User Controls.
The Idea is that of a Page with RadSplitter ad a PlaceHolder that loads dynamically user controls into the PlaceHolder. Plus, to make everything really smooth I have a RadAjaxManager in the page wich controls loading.
Loading is fine (I've taken from your Active Skills RadControlsAJAXCourseware.pdf which is great !!!), but once loaded the User Control inside the PlaceHolder does not resize when I resize the Browser Page.
In this case my User Control holds a RadGrid, but I have many Control with different controls inside. 
I attach Code below:

Page holding Controls:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title>---</title>
    <link type="text/css" rel="Stylesheet" href="Resources/Style.css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager" runat="server">
    </telerik:RadScriptManager>
    
    <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
        <AjaxSettings>
             
            <telerik:AjaxSetting AjaxControlID="RadPanelBar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PH" />
                    <telerik:AjaxUpdatedControl ControlID="RadToolBar" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadToolBar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadToolBar" />
                    <telerik:AjaxUpdatedControl ControlID="PH" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager" runat="server">
    </telerik:RadStyleSheetManager>
     
    <telerik:RadFormDecorator ID="RadFormDecorator" runat="server" />
     
     
     
   <div style="width:100%;height:40px;">
    <div style="float:right;margin-right:10px;">
        <asp:Label runat="server" ID="L_Operator"></asp:Label><br />
        <asp:LinkButton runat="server" ID="LB_LogOut" Text="LogOut"></asp:LinkButton>
    </div>   
   </div>
    
   <telerik:RadSplitter ID="RadSplitter_Frame" runat="server" Width="100%" Height="100%" Orientation="Vertical" HeightOffset="40">
     
        <telerik:RadPane ID="RadPane_Frame_Left" runat="server" Width="200px" Height="100%">
             
                <telerik:RadPanelBar ID="RadPanelBar" runat="server" Width="100%" ExpandMode="MultipleExpandedItems">
                     
                </telerik:RadPanelBar>
             
        </telerik:RadPane>
         
        <telerik:RadPane ID="RadPane_Frame_Right" runat="server" Width="100%" Height="100%" Scrolling="None">
         
            <telerik:RadSplitter runat="server" ID="RadSplitter_Body" Width="100%" Height="100%" Orientation="Horizontal">
             
                <telerik:RadPane runat="server" ID="RadPane_Body_Top" Width="100%" Height="38px">
                    <telerik:RadToolBar runat="server" ID="RadToolBar" Width="100%">
                    </telerik:RadToolBar>
                </telerik:RadPane>
                 
                <telerik:RadPane runat="server" ID="RadPane_Body_Bottom" Width="100%" Height="100%">
                    <asp:PlaceHolder runat="server" ID="PH"></asp:PlaceHolder>
                </telerik:RadPane>
                 
            </telerik:RadSplitter>
                         
        </telerik:RadPane>
         
    </telerik:RadSplitter>
    </form>
</body>
</html>

User Control:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Operators.ascx.vb" Inherits="System_Operators" %>
 
<telerik:RadSplitter runat="server" ID="RadSplitter_Frame" Width="100%" Height="100%" Orientation="Horizontal">
 
    <telerik:RadPane runat="server" ID="RadPane_Top" Width="100%" Height="26px" >
    OPERATORS
    </telerik:RadPane>
     
    <telerik:RadPane runat="server" ID="RadPane_Body" Width="100%" Height="100%">
     
        <telerik:RadGrid ID="RadGrid" runat="server" AllowSorting="True" 
                        GridLines="None" Width="100%" Height="100%" AllowMultiRowSelection="True"
                        AllowPaging="True" PageSize="50" AutoGenerateColumns="false"
                        ShowStatusBar="True" style="border:0px;outline:none;">
                         
                        <GroupingSettings CaseSensitive="False" />
                         
                        <ExportSettings ExportOnlyData="True" OpenInNewWindow="True" />
                     
                        <ClientSettings>
                            <Selecting AllowRowSelect="True" />
                            <ClientEvents OnRowContextMenu="" OnRowDblClick="" />
                            <Scrolling AllowScroll="True" ScrollHeight="100%" UseStaticHeaders="True" />
                            <Resizing AllowColumnResize="True" />
                        </ClientSettings>
                         
                        <PagerStyle AlwaysVisible="true" />
                         
                        <MasterTableView OverrideDataSourceControlSorting="True" style="border:0px;outline:none;">
                            <NoRecordsTemplate>
                                  
                            </NoRecordsTemplate>
                             
                            <Columns>
                                <telerik:GridBoundColumn DataField="Name" HeaderText="Nome">
                                </telerik:GridBoundColumn>
                                 
                                <telerik:GridBoundColumn DataField="Surname" HeaderText="Cognome">
                                </telerik:GridBoundColumn>
                                 
                                <telerik:GridBoundColumn DataField="User" HeaderText="Utente">
                                </telerik:GridBoundColumn>
                                 
                                <telerik:GridBoundColumn DataField="Ruolo" HeaderText="Ruolo">
                                </telerik:GridBoundColumn>
 
                                 
                            </Columns>
                            <CommandItemSettings ExportToPdfText="Export to Pdf" />
                             
                            </MasterTableView>
                                 
                             
                            </telerik:RadGrid>
                             
        </telerik:RadPane>
</telerik:RadSplitter>

I'm not adding the code behind since I don't think it is relevant.

I'm stuk on this one and need some good ideas !

Thanks
Lorenzo

4 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 26 Nov 2010, 04:01 PM
Hello Lorenzo,

Could you please confirm if this happens only with resizing of the height, or the issue is with width as well? If it is the height only, try setting a fixed height for UpdatePanelHeight (or no value at all, too).

If the issue is with both width and height, could you please check what happens if you temporarily move the grid definition directly at the place of the PlaceHolder (taking out the user control) to see what is the default behavior of the splitter setup that you have?

All the best,
Tsvetina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Lorenzo
Top achievements
Rank 1
answered on 26 Nov 2010, 06:51 PM
Hi,
the problem is both with height and width.
I've tried your suggestion and moved the grid (and also one by one other controls to test them) out of the placeholder placing them directly into the page. What is outside gets resized correctly while stuff inside the placeholder doesn't.

Thanks

Lorenzo
0
Tsvetina
Telerik team
answered on 02 Dec 2010, 09:16 AM
Hello Lorenzo,

Could you please take a look at the attached project (which I created using your code) and let me know if it behaves as you would expected it to, and if so, can you find any differences in implementation between yours and mine and what are they? On my side it behaves as expected, so it might be the approach you use to load the user control, or the fact that you set width of 100% to the grid which is not needed and additionally could influence its rendering in container controls. 

Kind regards,
Tsvetina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Lorenzo
Top achievements
Rank 1
answered on 15 Dec 2010, 01:56 PM
Hi  Tsvetina,
thanks for your kind answer and forgive me for my late response.
My problem persists, but you example works !!!! The news is that in some pages works fine, in other doesn't. So I'll have to find out why ! 
I'll keep searching and if I find an answer I'll post it so to give maybe a help to someone else.
Thanks !

Lorenzo
Tags
Ajax
Asked by
Lorenzo
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Lorenzo
Top achievements
Rank 1
Share this question
or