Show dayview in portrait mode and weekview in landscape mode

Hi,

In one of my project, I want to show dayview in portrait mode and weekview in landscape mode. How can I achieve this


3 Replies 1 reply marked as answer

MS Muniappan Subramanian Syncfusion Team September 6, 2021 09:01 AM UTC

Hi Rupesh, 
 
We already have followed up with the Forum (168566) for the same query, please follow up with the forum for further updates.  
 
Regards,     
Muniappan Subramanian. 



RU Rupesh replied to Muniappan Subramanian September 6, 2021 11:50 AM UTC

Hi,

Forum ( 168566 ) was for customizing the header, but here I want to have different scheduler views based on landscape (week view) or portrait (day view) mode. I have also checked the sfschedule demo application on Android, but sfschedule is not rendering correctly in landscape mode



SS SaiGanesh Sakthivel Syncfusion Team September 7, 2021 07:39 AM UTC

Hi Rupesh, 
 
Thank you for the update. 
 
#Regarding Show dayview in portrait mode and weekview in landscape mode 
We have checked the reported query from our end. Your requirement can be achieved by changing the scheduler view type on size changing. Please refer to the following code snippet for your reference. 
 
Code Snippet 
this.Schedule.SizeChanged += Schedule_SizeChanged; 
 
 

private
void Schedule_SizeChanged(object sender, EventArgs e) 
{ 
    if (DeviceDisplay.MainDisplayInfo.Orientation == DisplayOrientation.Landscape) 
    { 
        this.Schedule.ScheduleView = ScheduleView.WeekView; 
    } 
    else 
        this.Schedule.ScheduleView = ScheduleView.DayView; 
} 
 
Note: 
In the example by using the SizeChanged event of SfSchedule, view type changed by comparing the orientation of device with the help of Xamarin.Essentials.DeviceDisplay. 
 
 
Please let us know more details if the shared information not meets your requirement.  
 
Regards,
SaiGanesh Sakthivel


Marked as answer
Loader.
Up arrow icon