Raddock shifts position on postback

3 posts, 0 answers
  1. brian
    brian avatar
    23 posts
    Member since:
    Aug 2008

    Posted 29 Sep 2011 Link to this post

    Hi,

    I have Raddock with my custom logic as appointment form over Scheduler. It works well except for one little issue.

    I have checkbox on the Raddock that fires full postback (I use event CheckedChanged event for hiding/showing more controls). For some reason upon that full postback my Raddock form shifts from the center to the upper left corner. I would appreciate if you could advise how to keep Raddock position intact upon full postbacks. Thanks! See below my design view of aspx page:
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">


    <script type="text/javascript">
    function openForm() {
    var dock = $find("<%= RadDock1.ClientID %>");
    // Center the RadDock on the screen
    var viewPort = $telerik.getViewPortSize();
    var xPos = Math.round((viewPort.width - parseInt(dock.get_width())) / 2);
    var yPos = Math.round((viewPort.height - parseInt(dock.get_height())) / 2);
    $telerik.setLocation(dock.get_element(), { x: xPos, y: yPos });


    dock.set_closed(false);


    Sys.Application.remove_load(openForm);
    }


    function hideForm() {
    var dock = $find("<%= RadDock1.ClientID %>");
    dock.set_closed(true);


    return true;
    }


    function dockMoved(sender, args) {
    //Return RadDock to his original HTML parent so it gets updated via ajax
    $get("<%= DockPanel.ClientID %>").appendChild(sender.get_element());
    }

    </script>


    </telerik:RadScriptBlock>
    <asp:UpdatePanel runat="server" ID="UpdatePanel1" ChildrenAsTriggers="true" >
    <ContentTemplate>
    <asp:Panel runat="server" ID="DockPanel">
    <telerik:RadDock runat="server" ID="RadDock1"  Skin="Windows7" Width="800px" Height="600px" Closed="true"
    Style="z-index: 2000;" Title="Appointment" OnClientDockPositionChanged="dockMoved" >
      
    <ContentTemplate>


    <asp:CheckBox ID="chkAllDay" runat="server" Checked = "true" AutoPostBack="true" Text="All Day" />

    </ContentTemplate>


    </telerik:RadDock>
    </asp:Panel>




    <telerik:RadScheduler ID="RadScheduler1" runat="server"  Skin="Windows7" DataEndField="End" DataKeyField="ID"
    DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" 
    DataDescriptionField="Description"
    DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject"
    HoursPanelTimeFormat="htt" OverflowBehavior="Expand" ValidationGroup="RadScheduler1" 
    OnFormCreating="RadScheduler1_FormCreating"
    StartEditingInAdvancedForm="false"
    StartInsertingInAdvancedForm="false"                 
    AppointmentContextMenuSettings-EnableDefault="true" 
    TimeSlotContextMenuSettings-EnableDefault="true"  SelectedView="MonthView">

    </telerik:RadScheduler>
    </ContentTemplate>
    </asp:UpdatePanel>
  2. brian
    brian avatar
    23 posts
    Member since:
    Aug 2008

    Posted 30 Sep 2011 Link to this post

    Hello,

    I would appreciate if Telerik experts could provide some comments on my question formulated above.

    Thanks!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 04 Oct 2011 Link to this post

    Hi Brian,

    You can check the solution of the problem at hand in your support ticket on the matter. Please use only one ticket for a particular issue when requesting support in the future, as otherwise the consistency of our correspondence will be disrupted and it will take additional time to isolate the exact problem. That being said, I would suggest continuing our discussion in the corresponding support ticket.

    All the best,
    Slav
    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
Back to Top