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

Raddock shifts position on postback

2 Answers 90 Views
Dock
This is a migrated thread and some comments may be shown as answers.
brian
Top achievements
Rank 1
brian asked on 30 Sep 2011, 12:12 AM
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 Answers, 1 is accepted

Sort by
0
brian
Top achievements
Rank 1
answered on 30 Sep 2011, 06:11 PM
Hello,

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

Thanks!
0
Slav
Telerik team
answered on 04 Oct 2011, 12:57 PM
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
Tags
Dock
Asked by
brian
Top achievements
Rank 1
Answers by
brian
Top achievements
Rank 1
Slav
Telerik team
Share this question
or