Hi,
Is there a way to search for an event in SfScheduler which is then also displayed?
Thank you in advance for your efforts.
Hi Jurgen,
We would like to inform you that we need more details to check the reported scenario from our side. Please share the following details which will help us to check on it and provide you with the solution as soon as possible.
Share the exact details to achieve.
Share the ouput image to achieve.
Regards,
SaiGanesh Sakthivel
Hello,
it's about the calendar same as in the demo (.net core):
The question here is whether it is possible for the user to search for calendar entries and then have the data displayed. True to the MVVM modeling, the calendar is bound to an ObservableCollection in which all the data is located.
Hi Jurgen,
Your requirement can be achieved with the help of LoadOnDemand Command in SfScheduler. Inside the LoadOnDemand command, you can filter the appointments with the help of visible dates of the view and set the collection to display in the view. Please refer to the code snippet for your reference.
Code snippet
public async void ExecuteOnDemandLoading(object parameter) { if (parameter == null) { return; }
this.ShowBusyIndicator = true; await Task.Delay(500); await Application.Current.MainWindow.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() => { this.Events = this.GenerateSchedulerAppointments((parameter as QueryAppointmentsEventArgs).VisibleDateRange); })); this.ShowBusyIndicator = false; }
/// <summary> /// Method to generate scheduler appointments based on current visible date range. /// </summary> /// <param name="dateRange">Current visible date range.</param> private IEnumerable GenerateSchedulerAppointments(DateRange dateRange) {
var appointments = new ObservableCollection<SchedulerModel>();
foreach (SchedulerModel app in ActualEvents) { if ((app.From.Date >= dateRange.ActualStartDate.Date && app.From.Date <= dateRange.ActualEndDate.Date) || (app.To.Date >= dateRange.ActualStartDate.Date && app.To.Date <= dateRange.ActualEndDate.Date)) appointments.Add(app); }
return appointments; } |
Please refer to the tested sample in the following locations.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SchedulerWPF1802576326
Please let us know if you have any concerns.
Regards,
SaiGanesh Sakthivel
Hi,
thank you for this Information, but where ist there a search Function such as in the Outlook calendar?
When you enter a search term, the calendar is already loaded. I imagine a text box in which you can enter a search text and then the calendar will display the corresponding entry with its day.
Regards Juergen
Hi Jurgen,
Your requirement can be achieved at the sample level. We suggest you filter the search text in the scheduler itemsource and bind the filter items in the listview to display in the view. Please refer to the following code snippet for your reference.
Code snippet
private void text_TextChanged(object sender, TextChangedEventArgs e) { if ((sender as TextBox).Text == "") { listview.Visibility = Visibility.Collapsed; scheduler.Visibility = Visibility.Visible; } else { listview.Visibility = Visibility.Visible; scheduler.Visibility = Visibility.Collapsed; var data = new ObservableCollection<SchedulerModel>(); foreach (SchedulerModel item in scheduler.ItemsSource) { if (item.EventName.ToLower().Contains((sender as TextBox).Text.ToLower())) data.Add(item); }
listview.ItemsSource = data; } } |
Please refer to the demo sample in the following locations.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SchedulerWPF-1811926456
Please let us know if you have any concerns.
Regards,
SaiGanesh Sakthivel
Hi SaiGenesh,
it is a simple and good Solution.
How can I get back to the corresponding calendar entry in the calendar view by double-clicking, for example?
The target is that I can then use code to display the calendar in such a way that the selected entry has a focus.
Regards Juergen
Hi Jurgen,
#Regarding DoubleTap to return the scheduler control
Your requirement can be achieved with the help of MouseDoubleClick event in the Listview. Inside the event, you can navigate to the double tapped item in the scheduler view. Please refer to the following code snippet for your reference.
Code snippet
private void listview_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (e.Source != null) { listview.Visibility = Visibility.Collapsed; scheduler.Visibility = Visibility.Visible; var selectedItem = (e.Source as ListView).SelectedItem as SchedulerModel; scheduler.NavigateTo(selectedItem.From); } } |
Please refer to the demo sample in the following locations.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SchedulerWPF-750504194
Please let us know if you have any concerns.
Regards,
SaiGanesh Sakhtivel
Hi SaiGanesh,
thanks for this perfekt work :-)
Regards,
Jürgen