Articles in this section
Category / Section

How to get date and appointment details while tapping view header ?

1 min read

In SfSchedule, you can get the selected date details in view header of Schedule using ViewHeaderTapped event which will be fired while tapping date in the view header panel.

 

XAML

  
     <syncfusion:SfSchedule
       x:Name="schedule" ScheduleView="WeekView" 
       HorizontalOptions="FillAndExpand"  
       VerticalOptions="FillAndExpand" >
      </syncfusion:SfSchedule>
 

 

In ViewHeaderTapped, DateTime of the selected date in the view header panel will be known. Selected date time will be known for all the schedule views. In month view, the dates in the first row (row immediate below the view header) will be known in the DateTime parameter in the event.

 

C#

 
  schedule.ViewHeaderTapped += Schedule_ViewHeaderTapped;
  
   void Schedule_ViewHeaderTapped(object sender, ViewHeaderTappedEventArgs e)
   {
          //date of the selected item. 
          var dateTime = e.DateTime;
          DisplayAlert("SelectedDate",e.DateTime.Day.ToString(),"Ok");
   } 
 

 

You can also switch schedule views by setting the required ScheduleView type in the ViewHeaderTapped event.

../Desktop/Android_Gauge/ViewHeader_Date.jpg

 

You can download the source code for entire demo of switching schedule view through event from here, ScheduleSample.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied