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

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

8 Answers 92 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 10 Jul 2012, 06:53 PM
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 



8 Answers, 1 is accepted

Sort by
0
Ahmed
Top achievements
Rank 1
answered on 14 Jul 2012, 02:59 PM
HELP.............
0
Rav
Top achievements
Rank 2
answered on 16 Sep 2012, 02:21 AM
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
0
Yana
Telerik team
answered on 17 Sep 2012, 02:48 PM
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.

0
Rav
Top achievements
Rank 2
answered on 18 Sep 2012, 01:23 PM
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.
0
Yana
Telerik team
answered on 20 Sep 2012, 12:48 PM
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.

0
Rav
Top achievements
Rank 2
answered on 20 Sep 2012, 10:58 PM
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
0
Ashu
Top achievements
Rank 1
answered on 26 May 2014, 11:47 AM
Hi I am having similar problem.
The given link is dead. Do you any new link for that.
0
Yana
Telerik team
answered on 26 May 2014, 12:02 PM
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.
 
Tags
ScheduleView
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Ahmed
Top achievements
Rank 1
Rav
Top achievements
Rank 2
Yana
Telerik team
Ashu
Top achievements
Rank 1
Share this question
or