One small drawback: When i right click to add a new appointment,
it opens a basic form. there i have to click "options" to open my advanced
form. I want my advanced form opened just after click to my "add new appoinment"
context menu item, as the basic form cannot provide all required data.
how can i achieve this?
(the less java the better :-) else please be explicit)
3 Answers, 1 is accepted
Try setting StartInsertingInAdvancedForm property of RadScheduler to true to allow inserting in advanced form.
ASPX:
<
telerik:RadScheduler
ID
=
"RadScheduler1"
runat
=
"server"
StartInsertingInAdvancedForm
=
"true"
.......... >
................
</
telerik:RadScheduler
>
Hope this helps.
Thanks,
Princy.
Surprisingly not, may be i messed up something else?
(Telerik.Web.UI, v.2012.2.607.40 (Dev))
My Scheduler:
<telerik:RadScheduler id="rsched1" runat="server"
StartEditingInAdvancedForm="true"
DataEndField="leistungsdatumbis" DataKeyField="id" CustomAttributeNames="wer,kulanz"
OnAppointmentDataBound="Rsched1AppointmentDataBound"
EnableRecurrenceSupport="False"
DataSourceID="odskalender" DataStartField="leistungsdatum" DataSubjectField="beschrieb"
EnableDescriptionField="False" Height="" >
<Reminders Enabled="false" />
<AdvancedForm Modal="true" />
<ResourceTypes>
<telerik:ResourceType KeyField="id" Name="Anforderung" TextField="name" ForeignKeyField="anforderungenid" DataSourceID="odsanforderungen" />
<telerik:ResourceType DataSourceID="odswer" ForeignKeyField="wer" KeyField="name" Name="User" TextField="name" />
</ResourceTypes>
<AppointmentTemplate><%# Eval("Subject") %><%# Eval("Description") %></AppointmentTemplate>
<AppointmentContextMenuSettings EnableDefault="false" />
<AdvancedEditTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>'
Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' wer='<%# Bind("wer") %>'
kulanz='<%# Bind("kulanz") %>'
anforderungenid='<%# Bind("anforderungenid") %>'
/>
</AdvancedEditTemplate>
<AdvancedInsertTemplate>
<scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
wer='<%# Bind("wer") %>'
kulanz='<%# Bind("kulanz") %>'
anforderungenid='<%# Bind("anforderungenid") %>' />
</AdvancedInsertTemplate>
<TimeSlotContextMenuSettings EnableDefault="true" />
<AppointmentContextMenuSettings EnableDefault="true" />
</telerik:RadScheduler>
My (test) codebehind:
public partial class Zeiterfassungskalender : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
InitializeLocalization();
}
protected override void InitializeCulture()
{
var userCulture = Session["UserCulture"];
if (userCulture == null)
Session["UserCulture"] = "de";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(Session["UserCulture"].ToString());
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Session["UserCulture"].ToString());
}
protected void eigene_OnCheckedChanged(object sender, EventArgs e)
{
rsched1.Rebind();
}
private void InitializeLocalization()
{
//this.rsched1.Culture = Thread.CurrentThread.CurrentCulture;
CultureInfo newCulture = CultureInfo.CreateSpecificCulture("DE");
rsched1.Culture = newCulture;
}
protected void Rsched1AppointmentDataBound(object sender, SchedulerEventArgs e)
{
string wer = e.Appointment.Attributes["wer"];
Color appointmentColor;
if (!string.IsNullOrEmpty(wer))
{
switch(wer.ToLower())
{
case "bpa":
appointmentColor = Color.Gold;
e.Appointment.BackColor = appointmentColor;
e.Appointment.BorderColor =Color.DarkSlateBlue;
e.Appointment.BorderStyle = BorderStyle.Solid;
e.Appointment.BorderWidth = Unit.Pixel(1);
break;
case "ami":
appointmentColor = Color.Green;
e.Appointment.BackColor = appointmentColor;
e.Appointment.BorderColor = Color.DarkSlateBlue;
e.Appointment.BorderStyle = BorderStyle.Solid;
e.Appointment.BorderWidth = Unit.Pixel(1);
break;
case "hae": appointmentColor = Color.DeepSkyBlue;
e.Appointment.BackColor = appointmentColor;
e.Appointment.BorderColor = Color.DarkSlateBlue;
e.Appointment.BorderStyle = BorderStyle.Solid;
e.Appointment.BorderWidth = Unit.Pixel(1);
break;
}
}
e.Appointment.ToolTip = e.Appointment.Subject + ": " + e.Appointment.Description;
} }
BTW: is there a smart way to copy paste from vs2010 into this window (IE9)
Without reformat everything manually?
I have reviewed the code that you posted and noticed that you have add StartEditingInAdvancedForm="true" but you still don't have the property that Princy suggested- StartInsertingInAdvancedForm="true".
Would you please add it and let us know if you still observe the same behavior.
Plamen Zdravkov
the Telerik team
you're absolutely right, that was it. Thanks a lot.
Marcel
Hello.
Confirming that this is still working, for all future users.
Thanks!