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

Dismissing reminders

4 Answers 95 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mouse
Top achievements
Rank 1
Mouse asked on 14 Feb 2011, 12:00 PM
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

4 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 14 Feb 2011, 12:42 PM
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.
0
Mouse
Top achievements
Rank 1
answered on 14 Feb 2011, 01:07 PM
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



0
Accepted
Veronica
Telerik team
answered on 14 Feb 2011, 02:25 PM
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.
0
Mouse
Top achievements
Rank 1
answered on 14 Feb 2011, 03:25 PM
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
Tags
Scheduler
Asked by
Mouse
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Mouse
Top achievements
Rank 1
Share this question
or