Persisting Dismissed

6 posts, 1 answers
  1. Stephen
    Stephen avatar
    86 posts
    Member since:
    Jan 2011

    Posted 06 Jul 2012 Link to this post

    Hello,

    I can't figure out how to get the RadSchedulerReminder to recognize that Appointments loaded from the database have already been dismissed.

    I have a custom Appointment class that inherits from Appointment.
    My database table has a Dismissed column.
    I set the Dismissed property to the value of the column when I load my appointments from the database. *All* my appointments have Dismissed = True at this point and they all have a start time of close to now.
    I set the RadScheduler.DataSource = BindingList(Of CustomAppointment)
    I start the RadSchedulerReminder.
    I get the reminder screen with every one of my appointments in it even though their Dismissed property is True.
    If I dismiss the appointments manually with the Dismiss button, they remain dismissed until I restart the application at which point it ignores the initial value of the property again.

    How do I get the RadSchedulerReminder to recognize the existing Dismissed state when it starts up?


    Thanks.





  2. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 10 Jul 2012 Link to this post

    Hello John,

    Thank you for your question.

    When you dismiss an appointment, its Dismissed property is set to true. To persist it in your database, you only need to map that property to the corresponding database column. The following code snippet demonstrates this:
    private void Form1_Load(object sender, EventArgs e)
    {
        AppointmentMappingInfo mapping = (this.schedulerBindingDataSource1.EventProvider.Mapping as AppointmentMappingInfo);
        mapping.Mappings.Add(new SchedulerMapping("Dismissed", "Dismissed"));
     
        // ...
    }

    I hope this will help you. Feel free to ask if you have any additional questions.

    All the best,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Stephen
    Stephen avatar
    86 posts
    Member since:
    Jan 2011

    Posted 10 Jul 2012 Link to this post

    Thank, that works.

    But, in the time I posted this question and now, I have implemented recurring appointments and that has made me wonder how persisting Dismissed would affect subsequent recurrences.

    If I dismiss(and persist) the MasterEvent when its reminder comes up, what happens to the next occurrence's reminder?
    Would it already be dismissed and no reminder comes up for it and all subsequent occurrences?
    Or, would it still generate a reminder...and I would have to create an exception for it to persist its dismissal?

    It makes me reconsider whether I should persist it at all and just live with the 15 minute timespan where I would get multiple reminders if I restart the app/refresh the calendar from the DB.


    Thanks.
  5. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 12 Jul 2012 Link to this post

    Hello John,

    The occurrences are not actually stored in the database but are created at runtime following the given recurrence pattern. If you dismiss an occurrence, this will not dismiss the MasterEvent and nothing will be stored in the database for that occurrence so you will get the reminder for that occurrence again when you open the form. Also, if you dismiss the master event, this will not dismiss all the occurrences because their Dismissed property is not copied from their master event when they are created.

    A possible solution is to keep in the database a list of dismissed dates. This way you will be able to set the Dismissed property when creating occurrences. A sample implementation of this approach can be found in the attached project.

    I hope you find it useful. Do not hesitate to write back in case you have any additional questions.

    All the best,
    Ivan Todorov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  6. Iheb
    Iheb avatar
    7 posts
    Member since:
    Jan 2013

    Posted 15 Aug 2013 Link to this post

    hello,

    i add a Dimissed column in my database, when i click in dimiss button the column have True value, so now how can i load in reminder only when Dismissed=false

    thanks
  7. George
    Admin
    George avatar
    500 posts

    Posted 20 Aug 2013 Link to this post

    Hi Iheb,

    Thank you for writing.

    I find it hard to understand your question exactly, but in case you do not want to show the reminder for dismissed appointments - you just need to load the appointments from the database and the reminder will ignore them. Ivan's project contains a very useful pieces of code. Please take a look at it or get back to me with more detailed information, this will help me provide you with adequate support.

    I hope this helps.

    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready