This is a migrated thread and some comments may be shown as answers.

ViewDefinitions doesn't work properly if group filter is bound

3 Answers 43 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Veteran
Markus asked on 14 Oct 2019, 07:53 AM

Hi,

we have a strange behavior, when we bound a group filter.

                <telerik:RadScheduleView.ViewDefinitions>
                    <telerik:DayViewDefinition  GroupFilter="{Binding VmGroupFilter}" DayStartTime="06:00" DayEndTime="19:00" TimerulerMajorTickStringFormat="{}{0:H:mm}"/>
                    <telerik:WeekViewDefinition GroupFilter="{Binding VmGroupFilter}" DayStartTime="06:00" DayEndTime="19:00"/>
                    <telerik:MonthViewDefinition GroupFilter="{Binding VmGroupFilter}"/>
                </telerik:RadScheduleView.ViewDefinitions>
            </telerik:RadScheduleView>

The DayView works like expected, but now the week view is still a day view and the month view is the week view.
See attached screen shots.

Do you have any explanation for this?

 

3 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 16 Oct 2019, 12:13 PM

Hello Markus,

Thank you for the provided information and pictures.

I am afraid that I cannot say for certain what is the reason for the observed behavior based on the provided information.

I tested this scenario in the Grouping and Filtering RadScheduleView example from our demos, however I was not able to reproduce the demonstrated result. May I ask you to check the example out and see how it differs from the setup on your end? 

Should you need any further assistance, can you isolate the scenario in a sample project and send it over in a new support ticket (since projects cannot be attached to forum posts)? This will hopefully allow me to reproduce the scenario and investigate it. 

Regards,
Vladimir Stoyanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Markus
Top achievements
Rank 1
Veteran
answered on 16 Oct 2019, 12:57 PM

Hello Vladimir,

thank you for your answer.
Since you couldn't reproduce it, I went back to bug hunting ;)
And I found it
The problem was in the following function

That's the working version:

        private bool GroupFilterFunc(object groupName)

        {
            IResource resource = groupName as IResource;
            if (resource == null)
                return true;

            return GetEnabledGroups().Contains(resource.ResourceName, StringComparer.OrdinalIgnoreCase);
        }

and that's the non-working version:

        private bool GroupFilterFunc(object groupName)

        {
            IResource resource = groupName as IResource;
            if (resource == null)
                return false;

            return GetEnabledGroups().Contains(resource.ResourceName, StringComparer.OrdinalIgnoreCase);
        }

The "return true" if the resource is null makes the difference. 
Hard to find ;)

Regards,
Markus

0
Vladimir Stoyanov
Telerik team
answered on 17 Oct 2019, 01:48 PM

Hello Markus,

I am glad to hear that you were able to find the root of the problem. 

Thank you for sharing the solution with the community.

Regards,
Vladimir Stoyanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ScheduleView
Asked by
Markus
Top achievements
Rank 1
Veteran
Answers by
Vladimir Stoyanov
Telerik team
Markus
Top achievements
Rank 1
Veteran
Share this question
or