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

Custom Appoinment form

24 Answers 406 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 26 Mar 2010, 01:23 PM
I want to show a custom appointment form when the user double clicks on the radscheduler to create/edit appointments.

Right now it shows the built-in AppointmentEdit dialog. The data I need to capture is vastly different from what appears on the dialog. The only common elements are the dates. I also need to capture lots of other information that it doesn't make sense to inherit from the dialog. It's easier to create a custom form from scratch. I am hoping there is an event I can use to cancel the default dialog from appearing and display the custom form.

I looked through the documentation but didn't find any. I tried the AppointmentEditDialogShowing event without any effect.

Is this even possible.

24 Answers, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 31 Mar 2010, 03:44 PM
Hello Jay,

Thank you for contacting us. Please follow the step bellow:
1. Create a form that implements IEditAppointmentDialog or inherit the EditAppointmentDialog class. If you do not need some of the controls in the form, you can hide them.
2. Create an instance of your form.
3. Subscribe to the AppointmentEditDialogShowing event and replace the dialog on it. For additional information, please take a look at our Examples application, section Scheduler >> Data Binding.

If you have additional questions, feel free to ask.

All the best,
Dobry Zranchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jay
Top achievements
Rank 1
answered on 02 Apr 2010, 01:03 PM
Thanks for the reply.

I am trying to implement the IEditAppointmentDialog interface as I already have the appointment form. 

I am not sure what to do in the following methods of the IEditAppointmentDialog interface. Do you have any examples or sample code.

thanks

public bool EditAppointment(Telerik.WinControls.UI.IEvent appointment, Telerik.WinControls.UI.ISchedulerData schedulerData) 
{        
public void ShowRecurrenceDialog() 

0
JJ
Top achievements
Rank 1
answered on 05 Apr 2010, 10:09 PM

I can add the custom fields to the form but the data is not binding. Here is my full code listing of the main form where I amd binding to the data

Imports Telerik.WinControls.UI  
Imports Telerik.WinControls.UI.Scheduler  
Imports Telerik.WinControls.UI.Scheduler.Dialogs  
 
Public Class frmScheduler  
    Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs)  
        MyBase.OnLoad(e)  
        Me.RadSchedule.AppointmentFactory = New AppointmentFactoryClass()  
        ' Me.RadSchedule.AppointmentEditDialogShowing += New EventHandler(Of AppointmentEditDialogShowingEventArgs)(RadSchedule_AppointmentEditDialogShowing)  
        AddHandler RadSchedule.AppointmentEditDialogShowing, AddressOf RadSchedule_AppointmentEditDialogShowing  
        BindToDataSource()  
    End Sub 
 
    Private appointmentDialog As IEditAppointmentDialog = Nothing 
 
    Sub RadSchedule_AppointmentEditDialogShowing(ByVal sender As ObjectByVal e As AppointmentEditDialogShowingEventArgs)  
 
        If Me.appointmentDialog Is Nothing Then 
            Me.appointmentDialog = New CustomTelerikForm2()  
        End If 
        e.AppointmentEditDialog = Me.appointmentDialog  
    End Sub 
 
    Private Sub BindToDataSource()  
        Me.AppointmentsResourcesTableAdapter.Fill(Me.SomeDataSet.AppointmentsResources)  
        Me.ResourcesTableAdapter.Fill(Me.SomeDataSet.Resources)  
        Me.AppointmentsTableAdapter.Fill(Me.SomeDataSet.Appointments)  
 
        ' create and assign appointment mapping  
        Dim appointmentMappingInfo As New AppointmentMappingInfo()  
        appointmentMappingInfo.Start = "Start" 
        appointmentMappingInfo.[End] = "End" 
        appointmentMappingInfo.Summary = "Summary" 
        appointmentMappingInfo.Description = "Description" 
        appointmentMappingInfo.Location = "Location" 
        appointmentMappingInfo.BackgroundId = "BackgroundID" 
        'appointmentMappingInfo.StatusId = "StatusID"  
        appointmentMappingInfo.RecurrenceRule = "RecurrenceRule" 
        appointmentMappingInfo.Resources = "FK_AppointmentsResources_Appointments" 
        appointmentMappingInfo.ResourceId = "ResourceID" 
        SchedulerBindingDataSource1.EventProvider.Mapping = appointmentMappingInfo  
        SchedulerBindingDataSource1.EventProvider.DataSource = SomeDataSet.Appointments()  
 
        ' create and assign resource mapping  
        Dim resourceMappingInfo As New ResourceMappingInfo()  
        resourceMappingInfo.Id = "ID" 
        resourceMappingInfo.Name = "Name" 
        SchedulerBindingDataSource1.ResourceProvider.Mapping = resourceMappingInfo  
        SchedulerBindingDataSource1.ResourceProvider.DataSource = SomeDataSet.Resources()  
 
        ' assign mapped binding data source  
        RadSchedule.DataSource = SchedulerBindingDataSource1  
        Me.RadSchedule.GroupType = GroupType.Resource  
 
        Dim dataSource As New SchedulerBindingDataSource()  
        dataSource.EventProvider.AppointmentFactory = Me.RadSchedule.AppointmentFactory  
        appointmentMappingInfo.Mappings.Add(New SchedulerMapping("Email""Email"))  
    End Sub 
 
    Private Sub btnSave_Click(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles btnSave.Click  
        ' save scheduler changes  
        AppointmentsTableAdapter.Update(SomeDataSet.Appointments)  
        AppointmentsResourcesTableAdapter.Update(SomeDataSet.AppointmentsResources)  
    End Sub 
 
    Private Sub btnExit_Click(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles btnExit.Click  
        Me.Close()  
        Application.Exit()  
    End Sub 
End Class 
0
Dobry Zranchev
Telerik team
answered on 07 Apr 2010, 02:10 PM
Hi JJ,

I have updated the code snippet for you:
 
Private Sub BindToDataSource()
 Me.AppointmentsResourcesTableAdapter.Fill(Me.SomeDataSet.AppointmentsResources)
Me.ResourcesTableAdapter.Fill(Me.SomeDataSet.Resources)
Me.AppointmentsTableAdapter.Fill(Me.SomeDataSet.Appointments)
 
Dim schedulerBindingDataSource As New SchedulerBindingDataSource
 
' create and assign appointment mapping 
Dim appointmentMappingInfo As New AppointmentMappingInfo()
 
Dim dataSource As New SchedulerBindingDataSource()
dataSource.EventProvider.AppointmentFactory = Me.RadSchedule.AppointmentFactory
appointmentMappingInfo.Mappings.Add(New SchedulerMapping("Email", "Email"))
 
appointmentMappingInfo.Start = "Start"
appointmentMappingInfo.[End] = "End"
appointmentMappingInfo.Summary = "Summary"
appointmentMappingInfo.Description = "Description"
appointmentMappingInfo.Location = "Location"
appointmentMappingInfo.BackgroundId = "BackgroundID"
'appointmentMappingInfo.StatusId = "StatusID" 
appointmentMappingInfo.RecurrenceRule = "RecurrenceRule"
appointmentMappingInfo.Resources = "FK_AppointmentsResources_Appointments"
appointmentMappingInfo.ResourceId = "ResourceID"
schedulerBindingDataSource.EventProvider.Mapping = appointmentMappingInfo
schedulerBindingDataSource.EventProvider.DataSource = SomeDataSet.Appointments()
 
' create and assign resource mapping 
Dim resourceMappingInfo As New ResourceMappingInfo()
resourceMappingInfo.Id = "ID"
resourceMappingInfo.Name = "Name"
schedulerBindingDataSource.ResourceProvider.Mapping = resourceMappingInfo
schedulerBindingDataSource.ResourceProvider.DataSource = SomeDataSet.Resources()
 
' assign mapped binding data source 
RadSchedule.DataSource = schedulerBindingDataSource
Me.RadSchedule.GroupType = GroupType.Resource
End
Sub
 
I hope that this helps. If not, please provide an sample example in order to give you more appropriate help.

 
Best wishes,
Dobry Zranchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jay
Top achievements
Rank 1
answered on 07 Apr 2010, 02:29 PM
I would appreciate any help on the query posted on april 2.

Not sure how to implement the IEditAppointmentDialog  interface. Is there any sample code.

thanks
0
JJ
Top achievements
Rank 1
answered on 07 Apr 2010, 09:11 PM
Thanks that helped
0
Boyko Markov
Telerik team
answered on 12 Apr 2010, 01:18 PM
Hi Jay,

There are 2 options. The first one is to customize the existing EditAppointmentDialog. This is demonstrated in the Data Binding example of the Examples project. I would suggest that you take a look at the demo's source code. You can also refer to our online help documentation as there is a topic which describes how to customize the dialog: http://www.telerik.com/help/winforms/overview.html.

The second option is to create a completely new EditAppointmentDialog with custom controls and custom fields.We are currently working on a demo which demonstrates how to do this. If you are interested in it,  please let me know.

I hope this helps.

Sincerely yours,
Boyko Markov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jay
Top achievements
Rank 1
answered on 12 Apr 2010, 04:13 PM
I need to create a new EditAppointmentDialog  with custom controls.  I will appreciate if you could let me know when the demo is ready.

thanks



0
JJ
Top achievements
Rank 1
answered on 12 Apr 2010, 11:35 PM
HI Boyko Markov

Thanks for your answer, the full customization of the Appointment dialog will be appreciated by the community. I have not yet palyed around with this feature yet.
Thanks
JJ
0
Boyko Markov
Telerik team
answered on 15 Apr 2010, 09:50 AM
Hey guys,

You can find attached a sample which shows how to create a completely new EditAppointmentDialog and then associate it to the RadScheduler's instance.

Please feel free to post your feedback.
 

All the best,
Boyko Markov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mh
Top achievements
Rank 1
answered on 24 Nov 2014, 03:19 PM
by Sense1" in_hover="" in_hdr="" style="line-height: 20px; text-decoration: underline !important; border: none !important; display: inline-block !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">PLEASE help!!
I have  adding a new field like "Email" as above steps
but my field is a ForeignKey to another  by Sense1" style="line-height: 20px; text-decoration: underline !important; border: none !important; display: inline-block !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">TABLE
when the value is changed  got an  by Sense1" style="line-height: 20px; text-decoration: underline !important; border: none !important; display: inline-block !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">EXCEPTION 'ReferenceAlreadyHasValueException'
0
Dimitar
Telerik team
answered on 25 Nov 2014, 06:08 PM
Hello Mh,

Thank you for writing.

In this case you should manually convert the value using the foreign key. More Information is available here: Scheduler Mapping.

I hope this will be useful.

Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mh
Top achievements
Rank 1
answered on 25 Nov 2014, 06:33 PM
Hi,
I have added a new column 'ServiceId' ForeignKey and when have changed  an Exception thrown
"ForeignKeyReferenceAlreadyHasValueException"
Please Help
0
Dimitar
Telerik team
answered on 28 Nov 2014, 01:06 PM
Hi Mh,

Thank you for writing back.

I am not sure how we can reproduce this on our side. I have bound the scheduler to a custom field in such scenario, but as long as valid values are provided there is no exception. This makes me think that perhaps something in your database should be changed. This is why following the provided information I have created a small sample project which contains modified version of the scheduler sample database. When the appointment dialog is opened you will notice the custom field. Currently the valid values for it is "1" or "2" since the test table contains only two rows. Could you please check it and let me know how it fits in your case?

Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mh
Top achievements
Rank 1
answered on 28 Nov 2014, 03:24 PM
Hi,
Thanks for your replies,
The problem solved but I have another question.
How to print Appointments with LOCALIZATION, specifically the Calendar at the title.
thanks in advance,
Best regards.
0
Mh
Top achievements
Rank 1
answered on 30 Nov 2014, 06:14 PM
Anybody can help please...
0
Dimitar
Telerik team
answered on 03 Dec 2014, 02:45 PM
Hi Mh,

Thank you for writing back

This is currently not supported out of the box. I added a feature request for this in our Feedback Portal.  You can track the item for status changes and add your vote for it here.

Currently you can manually set the culture of the print elements, the month name however needs to be painted manually:
void radScheduler1_PrintElementFormatting(object sender, PrintElementEventArgs e)
{
    Console.WriteLine(e.PrintElement);
    CalendarPrintElement el = e.PrintElement as CalendarPrintElement;
    if (el != null)
    {
        el.DateTimeFormat = new CultureInfo("bg-BG").DateTimeFormat;
    }
}
 
void radScheduler1_PrintElementPaint(object sender, PrintElementPaintEventArgs e)
{
    SchedulerPrintCellElement element = e.PrintElement as SchedulerPrintCellElement;
    if (element != null)
    {
        element.Text = element.Date.ToString(element.DateFormat, new CultureInfo("bg-BG"));
    }
    CalendarPrintElement el = e.PrintElement as CalendarPrintElement;
    if (el != null)
    {
        var graphics = e.Graphics;
 
        StringFormat headerFormat = new StringFormat() { Alignment = StringAlignment.Center };
        var rect = new Rectangle(e.Bounds.X + 2, e.Bounds.Y, e.Bounds.Width - 4, 15);
        string monthName = el.Date.ToString("MMMM", new CultureInfo("bg-BG"));
        graphics.FillRectangle(Brushes.White, rect);
        graphics.DrawString(monthName, new Font(el.Font.Name,9,FontStyle.Regular), Brushes.Black, rect, headerFormat);
    }
}

Your Telerik Points have been updated for this report.

Should you have any other questions do not hesitate to ask.


Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mh
Top achievements
Rank 1
answered on 03 Dec 2014, 10:46 PM
Thanks for your help
when PrintStyle.DrawPageTitleCalendar is set to True
and CultureInfo("ar-SA")
there's an exception 'Valid values are between 1318 and 1500, inclusive.'

Thanks for your usual cooperation,
Best regards
0
Mh
Top achievements
Rank 1
answered on 03 Dec 2014, 11:19 PM
It's work perfect for 'SchedulerDayView'
but about 'SchedulerTimelineView' and 'SchedulerMonthView' there's still a problem.

Thanks a lot for your replies.
0
Dimitar
Telerik team
answered on 08 Dec 2014, 01:25 PM
Hello Mh,

Thank you for writing back.

Indeed the sample code does not cover all the print styles. To cover all cases you should use the CellPrintElementFormatting event as well:
void radScheduler1_CellPrintElementFormatting(object sender, PrintSchedulerCellEventArgs e)
{
    if (e.CellElement.DateFormat != null)
    {
        e.CellElement.Text = e.CellElement.Date.ToString(e.CellElement.DateFormat, new CultureInfo("bg-BG"));
    }
}

In addition you should format the month header text in the PrintElementFormatting event:
void radScheduler1_PrintElementFormatting(object sender, PrintElementEventArgs e)
{
     
    CalendarPrintElement el = e.PrintElement as CalendarPrintElement;
    if (el != null)
    {
        el.DateTimeFormat = new CultureInfo("bg-BG").DateTimeFormat;
    }
    RadPrintElement element = e.PrintElement;
    if (element != null && element.AngleTransform == -90)
    {
        string[] temp = element.Text.Split('-');
        if (temp.Length > 0)
        {
            DateTime startOfWeek = DateTime.Parse(temp[0]);
            element.Text = startOfWeek.ToString("MMM dd", new CultureInfo("bg-BG")) + " - " + startOfWeek.AddDays(6).ToString("MMM dd", new CultureInfo("bg-BG"));
        }
    }
}

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mary
Top achievements
Rank 1
answered on 18 Feb 2015, 10:08 AM
Hi Boyko,

This is extremely helpful. Is there any chance you could upload a VB .NET example?
0
Dimitar
Telerik team
answered on 18 Feb 2015, 03:07 PM
Hi Duncan,

Thank you for writing.

I am not sure which example you are pointing. Nevertheless in both cases you can use our online converter to convert the code to Visual Basic.

Do not hesitate to contact us if you have other questions.
 
Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Sohaib
Top achievements
Rank 1
answered on 23 Mar 2015, 10:25 AM
Hi, 

I am using radscheduler in a web form application, I have watch the video on this link 

http://tv.telerik.com/watch/winforms/radscheduler/adding-custom-fields-radscheduler-winforms-appointments

about using scheduler with custom attributes, as I am using web form application so I need a tutorial on this in which custom values being used and all teh crud operations is being performed. Thank you!






0
Dimitar
Telerik team
answered on 24 Mar 2015, 01:19 PM
Hi Sohaib,

This is the WinForms forum and the specified video contains a solution for the WinForms scheduler. Unfortunately, this solution does not apply for WebForms applications. This is why I want to kindly ask you to post your question in the appropriate forum section: Forum threads about Scheduler UI for ASP.NET AJAX.

Thank you for your understanding.

Regards,
Dimitar
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Scheduler and Reminder
Asked by
Jay
Top achievements
Rank 1
Answers by
Dobry Zranchev
Telerik team
Jay
Top achievements
Rank 1
JJ
Top achievements
Rank 1
Boyko Markov
Telerik team
Mh
Top achievements
Rank 1
Dimitar
Telerik team
Mary
Top achievements
Rank 1
Sohaib
Top achievements
Rank 1
Share this question
or