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

mark an schedule item as completed

3 Answers 143 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
cuongvt
Top achievements
Rank 1
cuongvt asked on 23 Jan 2011, 02:10 AM
We are investigating tekerik & devexpress scheduler (ASP.NET) for our intranet schedule app using by about 100 employees.
I would like to confirm if there is feature as below in telerik scheduler:
- Mark an scheduled item as completed.
1. Suppose I created a scheduled task. 
2. after ex 2 days, I completed this task.
3. I can manuaaly mark this task (by color or by checkmark or something else...) to indicate
    that this task has completed.
If there is this feature, could you can show a simple demo.

Thanks in advanced

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Jan 2011, 10:46 AM
Hello cuongvt,

Yes, this can be achieved using custom attributes or resources and templates.

Here is an example with custom attributes:

<telerik:RadScheduler runat="server" ID="RadScheduler1" CustomAttributeNames="Completed"
      AppointmentStyleMode="Default" EnableCustomAttributeEditing="true" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound">
      <AppointmentTemplate>
          <%#Eval("Subject") %>
          <br />
          Completed:
          <asp:CheckBox ID="CompletedStatusCheckBox" runat="server" Checked='<%# String.IsNullOrEmpty(Container.Appointment.Attributes["Completed"])? false : Boolean.Parse(Container.Appointment.Attributes["Completed"]) %>'
              AutoPostBack="true" OnCheckedChanged="CompletedStatusCheckBox_CheckedChanged" />
      </AppointmentTemplate>
  </telerik:RadScheduler>

protected void CompletedStatusCheckBox_CheckedChanged(object sender, EventArgs e)
  {
      CheckBox CompletedStatusCheckBox = (CheckBox)sender;
      SchedulerAppointmentContainer appContainer = (SchedulerAppointmentContainer)CompletedStatusCheckBox.Parent;
      Appointment appToUpdate = appContainer.Appointment;
      appToUpdate.Attributes["Completed"] = CompletedStatusCheckBox.Checked.ToString();
      RadScheduler1.UpdateAppointment(appToUpdate);
      RadScheduler1.Rebind();
  }
  protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
  {
      if (e.Appointment.Attributes["Completed"] == "True")
          e.Appointment.BackColor = System.Drawing.Color.Green;
  }

Attached is a demo for reference.

Best wishes,
Peter
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
Peter
Telerik team
answered on 24 Jan 2011, 11:35 AM

I played a bit more with this case, and improved to code to handle recurring appointments as well:
protected void CompletedStatusCheckBox_CheckedChanged(object sender, EventArgs e)
  {
      CheckBox CompletedStatusCheckBox = (CheckBox)sender;
      SchedulerAppointmentContainer appContainer = (SchedulerAppointmentContainer)CompletedStatusCheckBox.Parent;
      Appointment appointment = appContainer.Appointment;
      Appointment appointmentToUpdate = RadScheduler1.PrepareToEdit(appointment, RadScheduler1.EditingRecurringSeries);
      appointmentToUpdate.Attributes["Completed"] = CompletedStatusCheckBox.Checked.ToString();
      RadScheduler1.UpdateAppointment(appointmentToUpdate);
      RadScheduler1.Rebind();
  }


Best wishes,
Peter
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
cuongvt
Top achievements
Rank 1
answered on 24 Jan 2011, 11:48 AM
Thank you very much. We check your sample code.
once again, thank you
Tags
Scheduler
Asked by
cuongvt
Top achievements
Rank 1
Answers by
Peter
Telerik team
cuongvt
Top achievements
Rank 1
Share this question
or