scheduler get clicked date

2 posts, 0 answers
  1. Mark
    Mark avatar
    64 posts
    Member since:
    Nov 2009

    Posted 11 Dec 2009 Link to this post

     Hi,
     Please can you tell my how I can access the appointment clicked date in a RadScheduler. It is not the Selected date, as this seems to be the same no matter what date I click. You would have thought that this was simple, but apparently not.

    Below is the html for my scheduler and the onclick event


     <telerik:RadScheduler ID="RadSchedAbsence"
                   runat="server" AllowEdit="False" AllowInsert="False" AllowDelete="False"  Height="550px"
                      Culture="English (United Kingdom)" DataEndField="event_end" DataKeyField="id"
                      DataSourceID="sds_absence_for_scheduler" DataStartField="event_start" DataSubjectField="absence_detail"
                      SelectedView="MonthView" Width="600px" Visible="False" Skin="Vista" OnAppointmentClick="RadSchedAbsence_AppointmentClick" ReadOnly="True" >
                      <TimelineView UserSelectable="False" />
                      <WeekView UserSelectable="False" />
                      <DayView UserSelectable="False" />
                  </telerik:RadScheduler>

    // On appointment click event

              Servizio.Rota rota = new Servizio.Rota();

            DataTable dtAbsences ;

            dtAbsences = rota.GetAbsencesForDay(Convert.ToInt32(ddl_absenceType.SelectedValue), this.RadSchedAbsence.SelectedDate.ToString("yyyy-MM-dd"));
            //this.sds_absence_by_date.SelectParameters["absence_type_id"].DefaultValue = ddl_absenceType.SelectedValue;
            //this.sds_absence_by_date.SelectParameters["selected_date"].DefaultValue = this.RadSchedAbsence.SelectedDate.ToString("yyyy-dd-MM");

            RadGrid1.DataSource = dtAbsences;

            DataView returnedDataView = (DataView)sds_absence_by_date.Select(DataSourceSelectArguments.Empty);

            RadGrid1.DataBind();

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Dec 2009 Link to this post

    Hello Robert,

    Have you tried following code in AppointmentClick event to get the clicked date?

    CS:
     
        protected void RadScheduler1_AppointmentClick(object sender, SchedulerEventArgs e) 
        { 
            DateTime dt = (DateTime) e.Appointment.Start.Date; 
        } 

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top