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

scheduler get clicked date

1 Answer 167 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 11 Dec 2009, 11:27 AM
 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();

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Dec 2009, 11:45 AM
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.
Tags
Scheduler
Asked by
Mark
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or