Custom Appoinment form

25 posts, 0 answers
  1. Jay
    Jay avatar
    8 posts
    Member since:
    Aug 2009

    Posted 26 Mar 2010 Link to this post

    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.
  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 31 Mar 2010 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jay
    Jay avatar
    8 posts
    Member since:
    Aug 2009

    Posted 02 Apr 2010 Link to this post

    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() 

  5. JJ
    JJ avatar
    9 posts
    Member since:
    Mar 2010

    Posted 05 Apr 2010 Link to this post

    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 
  6. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 07 Apr 2010 Link to this post

    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.
  7. Jay
    Jay avatar
    8 posts
    Member since:
    Aug 2009

    Posted 07 Apr 2010 Link to this post

    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
  8. JJ
    JJ avatar
    9 posts
    Member since:
    Mar 2010

    Posted 07 Apr 2010 Link to this post

    Thanks that helped
  9. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 12 Apr 2010 Link to this post

    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.
  10. Jay
    Jay avatar
    8 posts
    Member since:
    Aug 2009

    Posted 12 Apr 2010 Link to this post

    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



  11. JJ
    JJ avatar
    9 posts
    Member since:
    Mar 2010

    Posted 12 Apr 2010 Link to this post

    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
  12. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 15 Apr 2010 Link to this post

    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.
  13. Mh
    Mh avatar
    11 posts
    Member since:
    Apr 2014

    Posted 24 Nov 2014 in reply to Boyko Markov Link to this post

    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'
  14. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 25 Nov 2014 Link to this post

    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.

     
  15. Mh
    Mh avatar
    11 posts
    Member since:
    Apr 2014

    Posted 25 Nov 2014 in reply to Dimitar Link to this post

    Hi,
    I have added a new column 'ServiceId' ForeignKey and when have changed  an Exception thrown
    "ForeignKeyReferenceAlreadyHasValueException"
    Please Help
  16. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 28 Nov 2014 Link to this post

    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.

     
  17. Mh
    Mh avatar
    11 posts
    Member since:
    Apr 2014

    Posted 28 Nov 2014 in reply to Dimitar Link to this post

    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.
  18. Mh
    Mh avatar
    11 posts
    Member since:
    Apr 2014

    Posted 30 Nov 2014 Link to this post

    Anybody can help please...
  19. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 03 Dec 2014 Link to this post

    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.

     
  20. Mh
    Mh avatar
    11 posts
    Member since:
    Apr 2014

    Posted 03 Dec 2014 in reply to Dimitar Link to this post

    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
  21. Mh
    Mh avatar
    11 posts
    Member since:
    Apr 2014

    Posted 03 Dec 2014 in reply to Mh Link to this post

    It's work perfect for 'SchedulerDayView'
    but about 'SchedulerTimelineView' and 'SchedulerMonthView' there's still a problem.

    Thanks a lot for your replies.
  22. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 08 Dec 2014 Link to this post

    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.

     
  23. Mary
    Mary avatar
    12 posts
    Member since:
    Jul 2014

    Posted 18 Feb 2015 in reply to Boyko Markov Link to this post

    Hi Boyko,

    This is extremely helpful. Is there any chance you could upload a VB .NET example?
  24. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 18 Feb 2015 Link to this post

    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.

     
  25. Sohaib
    Sohaib avatar
    2 posts
    Member since:
    Dec 2012

    Posted 23 Mar 2015 Link to this post

    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!






  26. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 24 Mar 2015 Link to this post

    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.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready