Dismissing reminders

5 posts, 1 answers
  1. Mouse
    Mouse avatar
    26 posts
    Member since:
    Sep 2009

    Posted 14 Feb 2011 Link to this post

    Hello,

    My reminders are set using
    DataReminderField="Reminder"
    On the aspx page. And I am having a problem with them resetting even after I have clicked on dismiss. They seem to keep popping up every time the page reloads.

    On dismiss I set the reminder field on the database to "-1" and then when
    protected void SchedAppointments_AppointmentDataBound(object sender, SchedulerEventArgs e)
    is called I set my reminders for each of my appointments like so.
    if ((Reminder != -1))
    {
     
    e.Appointment.Reminders.Add(new Reminder(Reminder));
    }

    Would the Scheduler still find and display the reminder if I do not do this? If so what should I put in my database for it not to be displayed after it has been dismissed instead of "-1"?

    Thank you
    Phil
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 14 Feb 2011 Link to this post

    Hi Mouse,

    It is very strange that after pressing "Dismiss" - the reminder's popup still appears. Could you please try to handle the OnReminderDismiss event and check if it fires.

    Could you please send me your project so I can inspect it and help you?

    Thank you!

    Greetings,
    Veronica Milcheva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Mouse
    Mouse avatar
    26 posts
    Member since:
    Sep 2009

    Posted 14 Feb 2011 Link to this post

    Hi Veronica

    Unfortunalty i can not give you a working version of the code. It is hugely dependant on our development server internal at the current time.
     
    I do know that when I click dismiss button on the reminder the OnReminderDismiss event is called and here is my code below which uses this event to set the reminder to "-1".
    protected void SchedAppointments_ReminderDismiss(object sender, ReminderDismissEventArgs e)
    {
        string connectionString = ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString;
        using (SqlConnection cn = new SqlConnection(connectionString))
        {
            SqlCommand cmd = new SqlCommand("usp_DismissAppointment", cn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@ID", e.Appointment.ID);
            cn.Open();
            cmd.ExecuteNonQuery();
        }
        SchedAppointments.DataSource = getAppointments();
        SchedAppointments.Rebind();
    }
     The stored procedure sets the Reminder field to -1.

    If I have set the reminder datafield on the aspx to the reminder field in the database. Would the scheduler still show the reminder even if it is set to -1?

    Thank you
    Phil



  4. Answer
    Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 14 Feb 2011 Link to this post

    Hi Mouse,

    According to the "DataBase Structure" Reminder field is of type nvarchar(256) which is interpreted as String in C#. So I thing the better option is to check for null string instead of "-1".

    Regards,
    Veronica Milcheva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  5. Mouse
    Mouse avatar
    26 posts
    Member since:
    Sep 2009

    Posted 14 Feb 2011 Link to this post

    Hi Veronica

    I have now changed the stored procedure to use null instead of "-1" and it seems to be working.

    Thank you for the help.
    Phil
Back to Top