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

How to open DIRECTLY the custom advanced insert form

3 Answers 139 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Marcel Härry
Top achievements
Rank 1
Marcel Härry asked on 03 Jul 2012, 01:03 PM
got my radscheduler working fine with objectdatasource against my sql-db.

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

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Jul 2012, 05:19 AM
Hi Marcel Harry,

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.
0
Marcel Härry
Top achievements
Rank 1
answered on 04 Jul 2012, 08:44 AM
Hi 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?
 

1
Accepted
Plamen
Telerik team
answered on 04 Jul 2012, 01:24 PM
Hello Marcel,

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.

Greetings,
Plamen Zdravkov
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.
Marcel Härry
Top achievements
Rank 1
commented on 04 Jul 2012, 01:33 PM

Hi Plamen
you're absolutely right, that was it. Thanks a lot.
Marcel
Johnny
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 08 Nov 2022, 02:50 PM | edited

Hello.

Confirming that this is still working, for all future users.

Thanks!

Tags
Scheduler
Asked by
Marcel Härry
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Marcel Härry
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or