BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
[c#]
schedule.VisibleDatesChangedEvent+= Schedule_VisibleDatesChangedEvent; |
[c#]
void Scehudle_VisibleDatesChangedEvent(object sender, VisibleDatesChangedEventArgs args) { var schedule = sender as SfSchedule; if (schedule.ScheduleView == ScheduleView.DayView) { //Load the schedule appointments } } |
[c#]
void Scehudle_VisibleDatesChangedEvent(object sender, VisibleDatesChangedEventArgs args) { var visibledatesCount = args.visibleDates.Count; if (visibledatesCount == 1)//DayView { //Load the schedule appointments } } |
Thanks a lot Sivakumar,
I don't know how a missed that event after messing with this for a while :)
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 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
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
Hi Sivakumar,
# Hiding a range of time slots:
Yes, that's exactly it.
Thanks,
Rúben Santos
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
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