We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Day change on DayView and week change on WeekView events

Thread ID:

Created:

Updated:

Platform:

Replies:

131301 Jul 3,2017 05:43 PM Aug 17,2017 12:59 PM Xamarin.Forms 16
loading
Tags: SfSchedule
Rúben Santos
Asked On July 3, 2017 05:43 PM

Hi,

Is it possible to detect day change (on DayView) or week change (on WeekView), reason being is that I need to load appointments beased on the view the user is using and on both views I can only allow day or week change when the current day or week appointments have been requested and displayed.

Thanks,
Rúben Santos

Sivakumar Punniya Moorthi [Syncfusion]
Replied On July 4, 2017 09:48 AM

Hi Rúben, 
 
Thank you for using Syncfusion products. 
 
As of now we don’t have the direct support to listen the Schedule view change in Schedule Xamarin.Forms, but it can be achieved through VisibleDatesChanged event, which will be triggered when changed the schedule view (and while navigate dates). Please find the below code example for above the same, 
[c#] 
schedule.VisibleDatesChangedEvent+= Schedule_VisibleDatesChangedEvent;  
 
  
By using this event, we can achieve your requirement (detect the schedule view type) in two ways, and appointment can be loaded to the view based on it.  
1.Achieve through the Schedule View property of schedule.  
2.Achieve through visible dates count. 
  
Please find the code example for this, 
 
# Achieve through the Schedule View property of schedule 
 [c#] 
void Scehudle_VisibleDatesChangedEvent(object sender, VisibleDatesChangedEventArgs args)
        {
            var schedule = sender as SfSchedule;
            if (schedule.ScheduleView == ScheduleView.DayView)
            {
                //Load the schedule appointments 
            }
        }
  
 
  
# Achieve through visible dates count 
 
 [c#] 
void Scehudle_VisibleDatesChangedEvent(object sender, VisibleDatesChangedEventArgs args)
        {
            var visibledatesCount = args.visibleDates.Count;
            if (visibledatesCount == 1)//DayView
            {
                //Load the schedule appointments 
            }
        }
 
 
  
Please let us know, if you have any query. 
  
Regards, 
Sivakumar P 


Rúben Santos
Replied On July 5, 2017 11:30 AM

Thanks a lot Sivakumar

I don't know how a missed that event after messing with this for a while :)


Sivakumar Punniya Moorthi [Syncfusion]
Replied On July 6, 2017 11:52 AM

Hi Rúben,

Thanks for your update.

We are glad to know that you have met your requirement. Please let us know if you need further assistance.

Regards,
Sivakumar P

Rúben Santos
Replied On July 7, 2017 04:14 PM

Hi again,

Is there a reason why every time the SfSchedule is initiated or after that when the user rotates the screen the VisibleDatesChangedEvent is triggered 4 or 3 times, it seems like a normal behavior would be just one time?

I ask this because I am going to be requesting a server for data and I'm using additional variables to mitigate that but it seems odd having to do this, so that I only request the server one time per day or week.

Thanks.



Sivakumar Punniya Moorthi [Syncfusion]
Replied On July 10, 2017 07:00 AM

Hi Rúben, 

Thanks for the update.

We have created a support incident under your account to track the status of this issue. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

Please let us know, if you have any query.

Regards,
Sivakumar P. 


Rúben Santos
Replied On July 10, 2017 07:25 PM

Sivakumar thanks again for the work around...

In the meantime, other questions came up, first, to force the appointments update on the view I always set the Schedule.DataSource = null first because I found that it wouldn't update the view right way, I was just wondering if that's correct or is there a more direct way?

Now, about the time column, I trying to make the start time be at 8:00 and the end time at 01:00 in the night and everything else non Accessible Blocks, the problem here is that I would like to hide them and also the time from 00:00 to 01:00 visible in the end instead of the beginning the schedule...

Finally, is possible to have some overlapping line indicating the current system time or something similar?

Thanks again for all the help,

Rúben Santos


Sivakumar Punniya Moorthi [Syncfusion]
Replied On July 12, 2017 05:53 AM

Hi Rúben, 
  
Thanks for the update. 
  
# Update Schedule Appointment Collection: 
Based on the given information,  we suspect that your requirement is to force update the appointments in schedule views. Could please let us know the requirement of force updating the appointment collection on schedule view. Also, Please update us with simple sample along with its replication procedure? It will be very helpful for us to analyse on it and provide you the possible solution. 
  
# Hide schedule timeslot and shows the specific one: 
As of now we don’t have the support to hide the specific timeslots. We have consider this to be a feature request, could you let us know with the following details, 
-          Simple illustrated image regarding this support. 
-          Requirement of this hiding timeslots. 
It will be helpful for us to consider while implementing this feature. 
  
# Change the visibility of schedule timeslots: 
Since the shared information was not sufficient to analyzing your query. Could you please elaborate your requirement with more details. It will be helpful for us to analyse on it and provide the better solution. 
  
# Current Time Indicator: 
As of now the mentioned support “current time indicator” was not available in schedule Xamarin.Forms. We have already logged the feature report for this, we will implement this feature in any of our upcoming volume release. We will let you know once the implementation has done. 
  
Please let us know, if you have any query. 
  
Regards, 
Sivakumar P 


Rúben Santos
Replied On July 12, 2017 05:52 PM

Hi Sivakumar,

# Update Schedule Appointment Collection:

So I asked this because the appointments are never fixed, I have to request them all the time and nothing is save locally, they are loaded to memory, displayed and if you go to then next day or week only the new remain, the old ones are discarded, this requirement is due to keep the data that the user is seeing correct as much as possible. When I was trying to do this I noticed if I always gave a new collection to the data source, the old appointments would remain, which is I realized is normal, but in order to achieve the requirements I'm doing this:  

ScheduleViewModel.Instance.UpdateAppoitments(); //clears the Appointments collection and loads it again with updated data
Schedule.DataSource = null;
Schedule.DataSource = ScheduleViewModel.Instance.Appointments; //collection that is cleared and updated in the first line

This way the schedule view isn't updated right way, meaning the old appointments remain until a second update of the DataSource happens or when they are viewed again, behavior doesn't pose a problem. In this case my question was only to know if there's a more deficient way to achieve this.  

# Hide schedule timeslot and shows the specific one and # Change the visibility of schedule timeslots: 

In this case, I apologize for not been able to explain my self better, what I meant was, currently I'm using the time in 24 Hours format, so the first time slot begins at 00:00 hours and ends at 23:00, since the time slots from 00:00 to 08:00 will never be used in this situation it would be better if they weren't there at all, so that the user doesn't need to do so much swipe between the begin and the end of the schedule. I have included in the zip file imgs the current state of the schedule (current_schedule.png) and what I want to achieve (target_schedule.png). In the previous post I said that I wanted to hide the non accessible blocks but it doesn't have to be necessarily this in specific, it may be a good idea to allow any range of time slots to be hidden.

In the end of the question what I asked is described in the image time_slots.png, in the bottom of the schedule the last time slot is 23:00 and I wanted to have the next two time slots 00:00 and 01:00 right after instead of them appearing in the beginning, but its not a requirement any more, I not sure if this is possible to do with the current build of the schedule, if not, it may be a helpful feature for someone in the future.


Finally, it would be very important if the features of hiding a range of time slots (being non accessible blocks or not) and current time indicator could be available in the next release, they are going to be very helpful...

Thanks a lot for the time spent, 

Rúben Santos



Attachment: imgs_c442dde3.zip

Sivakumar Punniya Moorthi [Syncfusion]
Replied On July 17, 2017 08:33 AM

Hi Rúben, 
  
Thanks for the update. 
  
# Update Schedule Appointment Collection: 
Currently we are analysing on your requirement with the provided information, we will let you know the details with in two business days(Jul 19, 2017). 
  
# Hiding a range of time slots: 
As of now we don’t have the support for hiding the time slots, We have consider this to be a feature request, in mean time could you please let us know your requirement is same as below? 
It will be helpful for us to consider while implementing this feature. 
  
#Change the visibility of schedule timeslots: 
Based on the given image(time_slots.png) we don’t have the support for keeping different timeslots in the same panel as well as its not recommended approach as per the scheduling standard. 
  
# Current Time Indicator:  
As per our earlier update, we will implement this feature in any of our upcoming volume release. We will let you know once the implementation has done.  
  
Regards, 
Sivakumar P 


Rúben Santos
Replied On July 17, 2017 11:36 AM

Hi Sivakumar,

# Hiding a range of time slots: 

Yes, that's exactly it. 

Thanks,

Rúben Santos


Sivakumar Punniya Moorthi [Syncfusion]
Replied On July 18, 2017 09:33 AM

Hi Rúben, 
  
Thanks for the update. 
  
We have logged the feature report for “Hiding schedule timeslot Ranges in Schedule” in our database, We will implement this feature in any of our upcoming volume release. We will let you know once the implementation has done. 
Also, as per previous update currently we are analysing your requirement(update the schedule appointment Collection) and we will let you know the details on July 19 2017. 
  
Regards, 
Sivakumar P 


Sivakumar Punniya Moorthi [Syncfusion]
Replied On July 19, 2017 09:05 AM

Hi Ruben,

Thanks for your patience.

Based on the given information we have checked and we are unable to reproduce the mentioned issue in Xamarin.Forms. We have prepared the simple sample based on your requirement, please find the sample link below,

SampleLink : ScheduleApp

If the given sample doesn’t meet your requirement, could you revert to us by modifying the provided sample based your scenario with issue reproducing details. It will be helpful for us to check on it and provide you the better solution.

Regards,
Sivakumar P

Rúben Santos
Replied On July 19, 2017 02:12 PM

Hi Sivakumar,

Thanks a lot for the sample, it help me realize my mistake, the problem is that I was always giving the same instance of the appointments list, instead of create a new instance.

With that, I'm now avoiding two instructions I was doing, setting the Schedule.DataSource = null and clearing the appointments list.

Regards,

Rúben Santos


Sivakumar Punniya Moorthi [Syncfusion]
Replied On July 20, 2017 11:51 AM

Hi Rúben,

Thanks for your update.

We are glad to know that you have met your requirement. Please let us know if you need further assistance.

Regards,
Sivakumar P

Rúben Santos
Replied On August 16, 2017 08:47 PM

Hi 

I have a quick question about the ScheduleAppointment object, is there a way to place a small image inside aligned to the bottom right? I have tried using the method Schedule_OnAppointmentLoadedEvent and I know its possible (didn't had time to explore it fully) but the ScheduleAppointment style is lost and difficult to replicate...

Thanks,

Rúben Santos


Sivakumar Punniya Moorthi [Syncfusion]
Replied On August 17, 2017 12:59 PM

Hi Rúben,

Thanks for the update.

We can add the custom view to the schedule appointment by using the appointment loaded event, we were prepared the simple sample based on your requirement. In this sample were added the image at the bottom right of the schedule appointment. Please find the sample link below,

Sample Link : ScheduleApp 
  
Please let us know, if you have any query.

Regards,
Sivakumar P 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;