How to change property value after open appointment dialog and make it reflect at UI

9 posts, 0 answers
  1. Ahmed
    Ahmed avatar
    2 posts
    Member since:
    Mar 2011

    Posted 10 Jul 2012 Link to this post

    i create my custom appointment to add two more properties like 

          public string Title
            {
                get { return _title; }
                set
                {
                    _title = value;
                    OnPropertyChanged("Title");
                }
            }
            public string Gender
            {
                get { return _gender; }
                set
                {
                    _gender = value;
                    OnPropertyChanged("Gender");
                }
            } 

    i change the Title after appointment dialog is open depend on gender change
    the Title  property is set well but it does not reflect at UI 



  2. Ahmed
    Ahmed avatar
    2 posts
    Member since:
    Mar 2011

    Posted 14 Jul 2012 Link to this post

    HELP.............
  3. DevCraft banner
  4. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 15 Sep 2012 Link to this post

    Hi

    We're in a similar situation, where the appointment dialog UI does not reflect changes in custom appointment VIewModel once the dialog is open.

    Can Telerik please provide an answer to this?

    Rav
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 17 Sep 2012 Link to this post

    Hello,

    Please make sure that you're using the Storage method of the AppointmentBase class when setting/getting custom properties. The approach is described in details in the following article:
    http://www.telerik.com/help/silverlight/radscheduleview-features-appointments-custom-appointment.html

    Kind regards,
    Yana
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  6. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 18 Sep 2012 Link to this post

    Hi

    Yes we are using it. Here is an extract from our class extension of AppointmentBase

    public string PatientName
            {
                get
                {
                    return Storage<AppointmentViewModel>()._patientName;
                }
                set
                {
                    var storage = Storage<AppointmentViewModel>();
                    if (storage._patientName != value)
                    {
                        storage._patientName = value;
                        OnPropertyChanged(() => _patientName);
                    }
                }
            }
     
    public bool IsHealthPromotion
            {
                get { return Storage<AppointmentViewModel>()._isHealthPromition; }
                set
                {
                    var storage = Storage<AppointmentViewModel>();
                    if (storage._isHealthPromition != value)
                    {
                        storage._isHealthPromition = value;
                        OnPropertyChanged(() => IsHealthPromotion);
                    }
                }
            }
     
    protected override void OnPropertyChanged(string propertyName)
            {
                base.OnPropertyChanged(propertyName);
     
                if (propertyName == "IsHealthPromotion")
                {
                    if (IsHealthPromotion)
                        PatientName = "health promotion";
                    else if (PatientName != null && PatientName.ToLower().Equals("health promotion"))
                        PatientName = string.Empty;
                }
            }

    When we select the checkbox for IsHealthPromotion it should set the PatientName textbox value to "health promotion"

    By debugging we see that this does occur in the code, it's even saving to server correctly. However the UI will not update PatientName textbox as we're selecting the checkbox.
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 20 Sep 2012 Link to this post

    Hello Rav,

    We've just created a new Code Library which demonstrates how you can update the appointment properties in the EditAppointmentDIalog. Please check it at the following link:
    http://www.telerik.com/community/code-library/silverlight/scheduleview/how-to-create-advanced-custom-editapointmentdialog.aspx

    If you have any issues with the approach, write to us again.

    Kind regards,
    Yana
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  8. Rav
    Rav avatar
    36 posts
    Member since:
    Nov 2011

    Posted 20 Sep 2012 Link to this post

    Hi Yana, 

    OK I found the code, and yes it did reflect changes in the UI thanks. However when I saved and opened the dialog again the changes were not persisted (even though they had saved correctly back to server). I removed this part 'ElementName=DialogRoot' and it worked.

     Rav
  9. Ashu
    Ashu avatar
    7 posts
    Member since:
    Apr 2014

    Posted 26 May 2014 Link to this post

    Hi I am having similar problem.
    The given link is dead. Do you any new link for that.
  10. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 May 2014 Link to this post

    Hello,

    Here is the correct link:
    How to Create Advanced Custom EditAppointmentDialog

    Regards,
    Yana
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
DevCraft banner