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

ReadOnly ScheduleView

1 Answer 170 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Ronak
Top achievements
Rank 1
Ronak asked on 19 Apr 2011, 07:37 PM
Hi there,
I am using Telerik rad Scheduler Control only to display events meaning readonly and love the way to achieve this just setting property  but issue with this control is performance so looking into ScheduleView control but there is no magic property like IsreadOnly anyway.
i need help how can i achieve same functionality where i want all events to be readonly and i am using WCF service to get data from sharepoint 2010 calendar.I have gone through resources from your site and did make me sense but don't know where it will in my case.

ViewModel

public ObservableCollection<AppointmentViewModel> Appointments {
            get;
            private set;
     }

public
MainViewModel(RadScheduleView _scheduler)  {
 
            if (!DesignerProperties.IsInDesignTool)  {
 
                Scheduler = _scheduler;
                var service = new PublicCalEventsServiceProxy();
                // Events = new ObservableCollection<PublicCalEventViewModel>();
                Appointments = new ObservableCollection<AppointmentViewModel>();
                _service = service;
                // _service.GetPublicCalEvents(HandleResult);
                _service.GetPublicCalEventsbyUrl(HandleResult);
                IsLoading = true;
            }
 
        }
//Callback from Service
        private void HandleResult(ObservableCollection<PublicEvent> result, Exception ex)  {
 
            IsLoading = false;
            Appointments.Clear();
            if (ex != null) {
                IsVisible = Visibility.Visible;
                ErrorMessage = ex.Message;
                return;
            }
            if (result == null) {
                return;
            }
            foreach (var publicCalEvent in result) {
                AppointmentViewModel appoinment = new AppointmentViewModel(publicCalEvent);
                Appointments.Add(appoinment)
            }
        }

AppointmentViewModel
Class

public class AppointmentViewModel : AppointmentBase {
        public AppointmentViewModel() {
 
        }
        public AppointmentViewModel(PublicEvent appointment) {
 
            this.UniqueId = appointment.UniqueId;
            this.Subject = appointment.Subject;
            this.Start = appointment.Start;
            this.End = appointment.End;
            this.Body = appointment.Body;
            this.IsAllDayEvent = appointment.IsAllDayEvent;
            this.Location = appointment.Location;
            
            //  this.Category = _scheduler.Categories.GetCategoryByName(appointment.Category);
        }
        public AppointmentViewModel(PublicEvent appointment, RadScheduleView _scheduler)  {
 
            this.UniqueId = appointment.UniqueId;
            this.Subject = appointment.Subject;
            this.Start = appointment.Start;
            this.End = appointment.End;
            this.Body = appointment.Body;
            this.IsAllDayEvent = appointment.IsAllDayEvent;
            this.Location = appointment.Location;
           // this.Category = _scheduler.Categories.GetCategoryByName(appointment.Category);
        }
        private string _UniqueId;
        public string UniqueId
        {
            get { return _UniqueId; }
            set
            {
                if (_UniqueId != value)
                {
                    _UniqueId = value;
                    this.OnPropertyChanged(UniqueId);
                }
            }
        }
        private string _location;
        public string Location
        {
            get { return this._location; }
            set
            {
                if (_location != value)
                {
                    this._location = value;
                    this.OnPropertyChanged(Location);
                }
            }
        }
        private string _body;
        public string Body
        {
            get { return _body; }
            set
            {
                if (_body != value)
                {
                    this._body = value;
                    this.OnPropertyChanged(Body);
                }
            }
        }
 
        public override IAppointment Copy()
        {
            IAppointment appointment = new AppointmentViewModel();
            appointment.CopyFrom(this);
            return appointment;
        }
 
        public override void CopyFrom(IAppointment other)
        {
            AppointmentViewModel appointment = other as AppointmentViewModel;
            if (appointment != null)
            {
                base.CopyFrom(other);
                UniqueId = appointment.UniqueId;
                Body = appointment.Body;
                Location = appointment.Location;
            }
 
        }
    }

Please advise

Thanks
Ronak

1 Answer, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 20 Apr 2011, 12:25 PM
Hi Ronak,

We have a nice help article that demonstrates how to make RadScheduleView read-only. You are not setting just one property, because the feature is much more flexible and powerful, but it is still simple enough:
http://www.telerik.com/help/silverlight/radscheduleview-features-speacialslots.html

Here is a running example:
http://demos.telerik.com/silverlight/#ScheduleView/SpecialSlots

Best wishes,
Valeri Hristov
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
Tags
ScheduleView
Asked by
Ronak
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or