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:
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>