Hi there, is it possible to use a Query Object to filter appointments in Scheduler ?
I have mamy Events and i have many users and customers
It will be usefull to filter them by theese fileds .
THX so much
Hi Francesco,
Yes, you can use a Query object to filter appointments in the Scheduler based on specific fields. This can be particularly useful when you have a large number of events.
public void OnChange(ChangeEventArgs<bool> args) { dynamic predicate = null; if (MargretChecked) { if (predicate != null) { predicate = predicate.Or("OwnerId", "equal", Convert.ToInt32(MargretId)); } else { predicate = new WhereFilter() { Field = "OwnerId", Operator = "equal", value = Convert.ToInt32(MargretId) }; } } ScheduleQuery = new Query().Where(predicate); } |
In this query we check whether the OwnerId field is checked or not, if checked we add it into the predicate, which on end will query based on the predicate value
For more detailed examples and usage, you can refer to this Syncfusion Blazor Scheduler demo where a similar approach is used to filter resources.
Regards,
Ram
Hi there, thx for all . Meanwhile i wrote something like that :
public IEnumerable<TodoActivity> todoactivitiesDataSource;
todostatusesDataSource = await TodoStatusService.SGetTodoStatuses();
todoactivitiesDataSource = todoactivitiesDataSource.Where(t => t.UserId == UserFilter);
Hi there, your suggest is perfect.
Non the question is that my values for preditate come from a dropdown
When i change value in the dropdown all is ok
I have a problem when i want to clear result in the dropdown
ho can i reset the value in the dropdown and apply a null filter ?
Hi Francesco Pruner,
Based on the shared details, if a dropdown is used and a null value is applied, you can use the ScheduleQuery = new Query() approach. If newQuery is set, the default query value is applied in the data source. Please try this solution and let us know if any further assistance is needed.
|
if (DropDownValue == null) { ScheduleQuery = new Query(); } |
Regards,
Ashok
Hi i tried to do it. But the problem is how to clear DD value ?
Hi Francesco,
We understand that you're looking to clear the value of a Dropdown (DD). There are two primary ways to clear the Dropdown values:
ShowClearButton Property: This property, when set to true, will display a clear button on the UI. Users can click this button to clear the dropdown values.
ClearAsync Method: If you wish to clear the dropdown values programmatically, you can use the ClearAsync method.
Please try these methods and let us know if you need further assistance or if you encounter any issues.
Regards,
Ram