Remove Fields From Custom Appointment Dialog

4 posts, 0 answers
  1. Ian Scholz
    Ian Scholz avatar
    2 posts
    Member since:
    Aug 2009

    Posted 13 May 2010 Link to this post

    Hello:

    I have seen plenty of posts, webinar and code examples detailing how to add custom fields to an inherited class of the Appointment dialog used with RadScheduler. What I would like to know is the reverse of adding custom fields; How do I remove fields from an inherited or derived class of the Appointment dialog. If I remove some of the default fields from the inherited form, will that cause unintended problems because I simply removed the unwanted fields from the form? Or is there a simpler way of hiding the form files by the way of property dialogs on the RadScheduler control, or should I simply hide (make the fields non visible) on the inherited form from the Appointment dialog?

    Thanks!

  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 14 May 2010 Link to this post

    Hello Ian Scholz,

    Thank you for writing.

    There is no better way to just hide the controls in the form. The other way is to create a custom form from scratch and perform this manually.

    If you have other questions do no hesitate to contact us.

    Kind regards,
    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. Ian Scholz
    Ian Scholz avatar
    2 posts
    Member since:
    Aug 2009

    Posted 14 May 2010 Link to this post

    Ok.  So I inherited from EditAppointmentDialog class and was able to hide the controls I did not want visible on the form but I'm not able to hide the associated labels;  At runtime the unwanted controls are not visible, but the associated labels are. 

    Also, all the properties are disabled for the label controls and are locked so I cannot hide or delete the them.  

    Additionally, I tried to set the title of the dialog to something other than the default but when the dialog is visible in the running application, I get the default title for my custom Appointment dialog.  How do I override this behavior?

    Thanks!
  5. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 17 May 2010 Link to this post

    Hi Ian Scholz,

    Thank for writing back to me.

    You are right about the labels and the other controls - we will unlock these in the next major release in order to allow for removing them. Please, excuse us for the inconvenience.

    You can change the EditAppointmentDialog title by:

    1. Creating a class that inherits RadSchedulerLocalizationProvider and overrides its method GetLocalizationString:
     
    class CustomLocalization : RadSchedulerLocalizationProvider
    {
        public override string GetLocalizedString(string id)
        {
            if (id == RadSchedulerStringId.AppointmentDialogTitle)
                return "custom title";
            return base.GetLocalizedString(id);
        }
    }
     
    The class RadSchedulerStringId contains all string constants that are represented in the scheduler. To change the title of the EditAppointmentDialog return a different value only if the requested id is
    AppointmentDialogTitle, otherwise call the base method.
     
    2. Set the new localization provider to be the default provider:
     
    RadSchedulerLocalizationProvider.CurrentProvider = new CustomLocalization();

    I hope this will help you.

    Sincerely yours,
    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.
Back to Top