Print setting for radscheduler

6 posts, 2 answers
  1. Sina
    Sina avatar
    8 posts
    Member since:
    Jun 2018

    Posted 25 Jul 2018 Link to this post

    Hi
    Could you help me how to customize scheduler print setting dialog. i need to to change the culture of two calendars in print setting dialog(they have been highlighted in my attached file).
  2. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3379 posts

    Posted 26 Jul 2018 Link to this post

    Hello, Sina,    

    In order to change the culture of the start/end RadDateTimePicker controls in the print settings dialog, you can 
    use a custom SchedulerPrintSettingsDialog and override its OnLoad method where you can specify the desired culture. For this purpose it is necessary to create a  custom SchedulerPrintSettingsDialogFactory as follows:

    public RadForm1()
    {
        InitializeComponent(); 
        this.radScheduler1.PrintSettingsDialogFactory = new CustomSchedulerPrintSettingsDialogFactory();
    }
     
    private void radButton1_Click(object sender, EventArgs e)
    {
        this.radScheduler1.PrintPreview();
    }
     
    public class CustomSchedulerPrintSettingsDialogFactory : IPrintSettingsDialogFactory
    {
        public Form CreateDialog(RadPrintDocument document)
        {
            return new CustomSchedulerPrintSettingsDialog(document);
        }
    }
     
    public class CustomSchedulerPrintSettingsDialog : SchedulerPrintSettingsDialog
    {
        public CustomSchedulerPrintSettingsDialog(RadPrintDocument document) : base(document)
        {
        }
     
        SchedulerPrintStyleSettings printStyleSettingControl;
     
        protected override Control CreateFormatControl()
        {
            printStyleSettingControl = base.CreateFormatControl() as SchedulerPrintStyleSettings;
            return printStyleSettingControl;
        }
     
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            RadDateTimePicker startDTP = printStyleSettingControl.Controls["groupBoxPageRange"].Controls["datePickerStartDate"] as RadDateTimePicker;
            startDTP.Culture = new System.Globalization.CultureInfo("bg-BG");
            RadDateTimePicker endDTP = printStyleSettingControl.Controls["groupBoxPageRange"].Controls["datePickerEndDate"] as RadDateTimePicker;
            endDTP.Culture = new System.Globalization.CultureInfo("bg-BG");
        }
    }

    I hope this information helps. If you have any additional questions, please let me know.  
     
    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Sina
    Sina avatar
    8 posts
    Member since:
    Jun 2018

    Posted 30 Jul 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thanks Dess for your useful info. but i have one more question, first day in my radscheduler starts at Saturday. however, when i open it in print review (weekly style ), it starts from Monday. how can i change it to Saturday?
  4. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3379 posts

    Posted 31 Jul 2018 Link to this post

    Hello, Sina,    

    The SchedulerWeeklyPrintStyle allows you to specify from which day the week starts by the FirstDayOfWeek property:

    SchedulerWeeklyPrintStyle schedulerPrintStyle = new SchedulerWeeklyPrintStyle();
    schedulerPrintStyle.FirstDayOfWeek = DayOfWeek.Tuesday;
    this.radScheduler1.PrintStyle = schedulerPrintStyle;
    this.radScheduler1.PrintPreview();



    I hope this information helps. If you have any additional questions, please let me know.  
     
    Regards,
    Dess
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Sina
    Sina avatar
    8 posts
    Member since:
    Jun 2018

    Posted 31 Jul 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thanks Dess...
    you makes me more curious to learn more details about print preview.
    for my print preview is set the DrawPageTitleCalendar property to true.
    DrawPageTitleCalendar = true;

    But i do not really know how i can change the font of page title calendar?

  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3379 posts

    Posted 01 Aug 2018 Link to this post

    Hello, Sina,    

    You can change the font of the calendar displayed in the print document by handling the RadScheduler.PrintElementFormatting event. Here is a sample code snippet:

    Font f = new Font("Arial", 12f, FontStyle.Italic);
     
    private void radScheduler1_PrintElementFormatting(object sender, PrintElementEventArgs e)
    {
        if (e.PrintElement is CalendarPrintElement)
        {
            e.PrintElement.Font = f;
        }
    }




    Additional information about customizing the print elements is available in the following help article: https://docs.telerik.com/devtools/winforms/scheduler/print-support/events-and-customization

    I hope this information helps. If you have any additional questions, please let me know.  
     
    Regards,
    Dess
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top