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

Appointment.isAllDay protected?

10 Answers 107 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 14 Jun 2010, 08:04 PM
I don't get it. I want to read/write appointment data from a database, and get/set IsAllDay. Sure, I can check that the start is 00:00:00 and that the end is 23:59:59 on the same date, but what kind of kludge is that?

What reason is there to protect this property?

10 Answers, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 17 Jun 2010, 04:03 PM
Hello Jim Benson,

Thank you for writing.

Indeed, this is by design, the reason being that this property is always set to true when  the appointment is equal or longer than a day. In a future release we may change the behavior in case we get more requests about it.
  

All the best,
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.
0
Jim
Top achievements
Rank 1
answered on 17 Jun 2010, 07:34 PM
Thanks for your response! Supposing that user feedback drives your development, I'll make my point.

The Edit Appt Dialog has the "All day event" checkbox. I have a corresponding column in the database table where I store appointments. It seems that the only uncooperative piece is the Appointment class itself. To me, it seems that either IsAllDay is an Appointment property, or it is not. If it is, then setting it based on the start and end times is a work-around - one that has been designed into the product.

I'll leave the subject alone now. My point of view is not always in agreement with that of other users, and I am not always the first to catch onto something. I'm just telling you what I presently perceive.
0
Accepted
Dobry Zranchev
Telerik team
answered on 23 Jun 2010, 11:06 AM
Hello Jim Benson,

Thank you for feedback me.

As we are close to the official release date of Q2 2010, we will not be able to make the necessary tests for the exposed AllDay property, so most probably we will make this property public in Q3 2010. Meanwhile, you can use the following code snippet in order to access the isAllDay member:
class CustomAppointment : Appointment
{
    public bool AllDay
    {
        get
        {
            return this.isAllDay;
        }
        set
        {
            if (this.isAllDay != value)
            {
                if (value)
                {
                    this.end = DateHelper.GetEndOfDay(this.start);
                }
 
                this.isAllDay = value;
            }
        }
    }
}

Your Telerik points have been updated for yoru feedback. I hope this will help you.

All the best,
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
0
Jim
Top achievements
Rank 1
answered on 23 Jun 2010, 07:26 PM
Thanks for the support!
0
Xavier Soares
Top achievements
Rank 2
answered on 04 Jan 2011, 05:58 PM
Hello,

How can  I Activate this behaviour?

I've created a new class

<i>Public Class CustomAppointment<br>
    Inherits Appointment<br>
    Public Property AllDay() As Boolean<br>
        Get<br>
            Return Me.isAllDay<br>
        End Get<br>
        Set(ByVal value As Boolean)<br>
            If Me.isAllDay <> value Then<br>
                If value Then<br>
                    Me.[End] = DateHelper.GetEndOfDay(Me.Start)<br>
                End If<br>
<br>
                Me.isAllDay = value<br>
            End If<br>
        End Set<br>
    End Property</i>


But now I don't now how to use this new class in my app.

Best regards,
Maurício
0
Richard Slade
Top achievements
Rank 2
answered on 04 Jan 2011, 06:28 PM
Hello Luis,

Please have a look at this documentation which will inform you how to implement and use a custom appointment.
Hope that helps
Richard
0
Xavier Soares
Top achievements
Rank 2
answered on 04 Jan 2011, 07:26 PM
Hi Richard,

Thanks for Your repply.

I don't think this solves my problem. I just need to associate a bit column (IsAllDayEvent) in my sql server to the AllDay property of RadScheduler.

In SQL Server the columns are True/1 but in RadScheduler the checkbox of All day is always cleared when I run the app! I've defined the AllDay property correctly in Edit Appointment Mapping but never workers!!!

Any sugestion?

Best regards
0
Xavier Soares
Top achievements
Rank 2
answered on 04 Jan 2011, 08:12 PM
Nevermind. I've added 24 hours to my End Date and now works great...

Best regards
0
Richard Slade
Top achievements
Rank 2
answered on 04 Jan 2011, 08:50 PM
Glad you have this working now.
Regards,
Richard
0
Dobry Zranchev
Telerik team
answered on 06 Jan 2011, 09:01 AM
Hi Luis,

Thank you for writing.

I am happy that you have found a solution. This is the correct approach to make an all day appointment.

If you have any additional questions, feel free to write back.

All the best,
Dobry Zranchev
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Tags
Scheduler and Reminder
Asked by
Jim
Top achievements
Rank 1
Answers by
Dobry Zranchev
Telerik team
Jim
Top achievements
Rank 1
Xavier Soares
Top achievements
Rank 2
Richard Slade
Top achievements
Rank 2
Share this question
or