5 Answers, 1 is accepted
Can you send us the code (both aspx and code behind with which you customize RadScheduler? Do you have any custom code in the NavigationComplete event?
Regards,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Here is my code, many thanks for your helping.
<%@ Page EnableViewState="false" Language="C#" AutoEventWireup="true" Inherits="CommunityServer.Controls.CSThemePage"
MasterPageFile="calendar.Master" %>
<%@ Import Namespace="CommunityServer.Controls" %>
<%@ Import Namespace="CommunityServer.Components" %>
<%@ Import Namespace="CommunityServer.Discussions.Components" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register TagPrefix="CSUserControl" TagName="AdTop" Src="../Common/Ad-Top.ascx" %>
<%@ Register TagPrefix="CSUserControl" TagName="AdBottom" Src="../Common/Ad-Bottom.ascx" %>
<%--<%@ Register TagPrefix="CAL" Namespace="DanBartels.CS.Calendar.Controls" Assembly="DanBartels.CS.Calendar" %>--%>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%--<%@ Register TagPrefix="CA" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>--%>
<%--vincent--%>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<script language="C#" runat="server">
void Page_Load()
{
SetTitle(CurrentCSContext.SiteSettings.SiteName, false);
UsersOnline.SetLocation("Calendar");
//if (IsPostBack == false)
//{
if (Membership.GetUser() != null)
{
string UserName = Membership.GetUser().UserName.ToString();
if (UserName == "admin")
{
this.RadScheduler1.AllowDelete = true;
this.RadScheduler1.AllowEdit = true;
this.RadScheduler1.AllowInsert = true;
}
else
{
this.RadScheduler1.AllowDelete = false;
this.RadScheduler1.AllowEdit = true;
this.RadScheduler1.AllowInsert = false;
}
}
else
{
this.RadScheduler1.AllowDelete = false;
this.RadScheduler1.AllowEdit = true;
this.RadScheduler1.AllowInsert = false;
}
//}
}
//protected override void OnInit(EventArgs e)
//{
// base.OnInit(e);
//}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="bcr" runat="server">
<script type="text/javascript">
<!--
function AppointmentEditing(sender, eventArgs)
{
// debugger
// AJAXEnabledWebApplication4.WebService.ExaminateLoginUser(SucceededCallback);
var apt = eventArgs.get_appointment();
window.radopen("AdvancedForm.aspx?Mode=Edit&AppointmentId=" + apt.ID, "AdvancedForm");
eventArgs.set_cancel(true);
currentApt = null;
}
// This is the callback function that
// processes the Web Service return value.
function SucceededCallback(result)
{
//debugger
if(result=="true")
{
var apt = eventArgs.get_appointment();
window.radopen("AdvancedForm.aspx?Mode=Edit&AppointmentId=" + apt.ID, "AdvancedForm");
eventArgs.set_cancel(true);
currentApt = null;
}
}
function AppointmentInserting(sender, eventArgs)
{
//debugger
var start = formatDate(eventArgs.get_startTime());
var isAllDay = eventArgs.get_isAllDay();
// New appointment
window.radopen("AdvancedForm.aspx?Mode=Insert&Start=" + start + "&IsAllDay=" + isAllDay, "AdvancedForm");
eventArgs.set_cancel(true);
}
function formatDate(date)
{
var year = padNumber(date.getUTCFullYear(), 4);
var month = padNumber(date.getUTCMonth() + 1, 2);
var day = padNumber(date.getUTCDate(), 2);
var hour = padNumber(date.getUTCHours(), 2);
var minute = padNumber(date.getUTCMinutes(), 2);
return year + month + day + hour + minute;
}
function padNumber(number, totalDigits)
{
number = number.toString();
var padding = '';
if (totalDigits > number.length)
{
for (i = 0; i < (totalDigits - number.length); i++)
{
padding += '0';
}
}
return padding + number.toString();
}
-->
</script>
<CS:SelectedNavigation Selected="calendar" runat="Server" ID="Selectednavigation1" />
<div class="CommonContentArea">
<CSControl:AdPart runat="Server" ContentName="StandardTop" ContentCssClass="CommonContentPartBorderOff"
ContentHoverCssClass="CommonContentPartBorderOn">
<DefaultContentTemplate>
<CSUserControl:AdTop runat="server" />
</DefaultContentTemplate>
</CSControl:AdPart>
<h2 class="CommonTitle">
行事曆!</h2>
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista">
<Windows>
<telerik:RadWindow ID="AdvancedForm" Title="Edit an Appointment" ReloadOnShow="true"
Modal="true" VisibleStatusbar="true" Behaviors="Default" runat="server" Width="333"
Height="333">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<telerik:RadScheduler ID="RadScheduler1" runat="server" Culture="Chinese (Taiwan)"
DataEndField="End" DataKeyField="ID" DataSourceID="rad_Appointments" DataStartField="Start"
DataSubjectField="Subject" FirstDayOfWeek="Monday" Height="650px" LastDayOfWeek="Sunday" OverflowBehavior="Scroll"
SelectedView="MonthView" ToolTip="快點兩下" Skin="Vista" StartInsertingInAdvancedForm="True"
OnClientAppointmentEditing="AppointmentEditing" OnClientAppointmentInserting="AppointmentInserting" DisplayRecurrenceActionDialogOnMove="True">
</telerik:RadScheduler>
<asp:SqlDataSource ID="rad_Appointments" runat="server" ConnectionString="<%$ ConnectionStrings:CommunityServerConnectionString %>"
DeleteCommand="DELETE FROM [rad_Appointments] WHERE [ID] = @ID" InsertCommand="INSERT INTO [rad_Appointments] ([Subject], [Start], [End], [UserID], [Annotations], [RecurrenceParentID], [RecurrenceRule], [RoomID]) VALUES (@Subject, @Start, @End, @UserID, @Annotations, @RecurrenceParentID, @RecurrenceRule, @RoomID)"
SelectCommand="SELECT [ID], [Subject], [Start], [End], [UserID], [Annotations], [RecurrenceParentID], [RecurrenceRule], [RoomID] FROM [rad_Appointments]"
UpdateCommand="UPDATE [rad_Appointments] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [UserID] = @UserID, [Annotations] = @Annotations, [RecurrenceParentID] = @RecurrenceParentID, [RecurrenceRule] = @RecurrenceRule, [RoomID] = @RoomID WHERE [ID] = @ID">
<DeleteParameters>
<asp:Parameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="UserID" Type="Int32" />
<asp:Parameter Name="Annotations" Type="String" />
<asp:Parameter Name="RecurrenceParentID" Type="Int32" />
<asp:Parameter Name="RecurrenceRule" Type="String" />
<asp:Parameter Name="RoomID" Type="Int32" />
<asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="UserID" Type="Int32" />
<asp:Parameter Name="Annotations" Type="String" />
<asp:Parameter Name="RecurrenceParentID" Type="Int32" />
<asp:Parameter Name="RecurrenceRule" Type="String" />
<asp:Parameter Name="RoomID" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
</div>
<CSControl:AdPart runat="Server" ContentName="StandardBottom" ContentCssClass="CommonContentPartBorderOff"
ContentHoverCssClass="CommonContentPartBorderOn">
<DefaultContentTemplate>
<CSUserControl:AdBottom runat="server" />
</DefaultContentTemplate>
</CSControl:AdPart>
</div>
</asp:Content>
<%--<asp:Content ContentPlaceHolderID="rcr" runat="server">
<div class="CommonSidebar">
<CSControl:TagCloud runat="server" IgnoreFilterTags="true" TagCssClasses="CommonTag6,CommonTag5,CommonTag4,CommonTag3,CommonTag2,CommonTag1" TagCloudCssClass="CommonSidebarTagCloud" MaximumNumberOfTags="25">
<LeaderTemplate>
<div class="CommonSidebarArea">
<div class="CommonSidebarRoundTop"><div class="r1"></div><div class="r2"></div><div class="r3"></div><div class="r4"></div></div>
<div class="CommonSidebarInnerArea">
<CSControl:ResourceControl ResourceName="PopularTags" Tag="H4" CssClass="CommonSidebarHeader" runat="server" />
<div class="CommonSidebarContent">
</LeaderTemplate>
<TrailerTemplate>
</div>
<CSControl:SiteUrl ResourceName="ViewAllTags" UrlName="tags_home" Tag="Div" CssClass="CommonSidebarFooter" runat="server" />
</div>
<div class="CommonSidebarRoundBottom"><div class="r1"></div><div class="r2"></div><div class="r3"></div><div class="r4"></div></div>
</div>
</TrailerTemplate>
</CSControl:TagCloud>
</div>
</asp:Content>--%>
We examined your code, but we didn't find anything in it which could cause the problem. I suggest you open a support ticket and send us a small project which we can run locally and test.
Greetings,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I find if I set EnableViewState="true", it will work properly.
Do you have any idea, why?
Thanks for clarifying. This turned out to be a bug which is fixed with the latest futures release. Please, download the latest version and give it a try. Attached is a screenshot showing which version you need.
All the best,
Peter
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center