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

Save button disabled

1 Answer 107 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yonggu Kang
Top achievements
Rank 1
Iron
Yonggu Kang asked on 13 Mar 2012, 05:02 PM

Hi telerik,

I had a custom appointment inherits from IAppointment as shown in your document,
but save button is disabled when appointment is newly created or edited after that.
However it is enabled when editing originally saved appointment which is loaded on scheduleview open.
I've read related thread and used CommandMnager.InvalidatexxxRequery on OnPropertyChanged
of custom appointment class,but same result.
I'm not using IDataErrornfo and any validation on edit widnow . What am I missing ?
I attached my custom class and imge.

   public class OrderAppointEntity : Appointment,IOrderAppointmentEntity
    {
   private string _partNo = string.Empty;
        public string PartNo
        {
            get { return this.Storage<OrderAppointEntity>()._partNo; }
            set
            {
                var storage = this.Storage<OrderAppointEntity>();
                if (storage._partNo != value)
                {
                    storage._partNo = value;
                    this.OnPropertyChanged(() => this.PartNo);
                }
            }
        }
.....
          public override IAppointment Copy()
        {
            var newAppointment = new OrderAppointEntity();
            newAppointment.CopyFrom(this);
            return newAppointment;
        }
 
        public override void CopyFrom(IAppointment other)
        {
            var order = other as OrderAppointEntity;
            if (order != null)
                FetchInfo(order.Id, order.Qty, order.PartNo, order.OrderType, order.Start, order.Unit);
            base.CopyFrom(other);
        }
 
  public void FetchInfo(int id, decimal qty, string partNo, OrderTypeEnums ordrType, DateTime start, string unit)
        {
            this.Id = id;
            this.Qty = qty;
            this.PartNo = partNo;
            this.OrderType = ordrType;
            this.Start = start;
            this.DateString = start.ToString("d");
            this.DelTime = start - start.Date;
            // always set 2 hrs
            this.End = start.AddHours(2);
            this.Unit = unit;
 
            SetSubject();
        }

I only use Start/Subject/End property among original ones.
My version is 2012.02.

Thank you in advance.
Kang

1 Answer, 1 is accepted

Sort by
0
Yonggu Kang
Top achievements
Rank 1
Iron
answered on 14 Mar 2012, 07:13 AM
Never mind..It was my fault not to fully understand the Appointment class  and
set  Start and End time wrong in custom class.

Thanks
Kang
Tags
ScheduleView
Asked by
Yonggu Kang
Top achievements
Rank 1
Iron
Answers by
Yonggu Kang
Top achievements
Rank 1
Iron
Share this question
or