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

Customizing ScheduleView GroupDesctription

3 Answers 164 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Rinku
Top achievements
Rank 1
Rinku asked on 10 May 2018, 06:16 AM

Hello,

I am trying to maintain group header template hierarchy to make group and sub-groups. I was able to use the example GroupingAndFilteringWithTreeView to understand how the grouping works. This is the simplified code that I was able to implement to see the grouping in action:

<telerik:RadScheduleView AppointmentsSource="{Binding Appointments}">
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:TimelineViewDefinition StretchGroupHeaders="True" />
            </telerik:RadScheduleView.ViewDefinitions>
            <telerik:RadScheduleView.GroupDescriptionsSource>
                <telerik:GroupDescriptionCollection>
                    <telerik:ResourceGroupDescription ResourceType="Airlines" />
                    <telerik:ResourceGroupDescription ResourceType="Segregations" />
                </telerik:GroupDescriptionCollection>
            </telerik:RadScheduleView.GroupDescriptionsSource>
            <telerik:RadScheduleView.ResourceTypesSource>
                <telerik:ResourceTypeCollection>
                    <telerik:ResourceType Name="Airlines">
                        <telerik:Resource ResourceName="Airline 0" />
                        <telerik:Resource ResourceName="Airline 1" />
                    </telerik:ResourceType>
                    <telerik:ResourceType Name="Segregations">
                        <telerik:Resource ResourceName="Segregation 0" />
                        <telerik:Resource ResourceName="Segregation 1" />
                        <telerik:Resource ResourceName="Segregation 2" />
                    </telerik:ResourceType>
                </telerik:ResourceTypeCollection>
            </telerik:RadScheduleView.ResourceTypesSource>
</telerik:RadScheduleView>

Here, Appointments is just a new ObservableCollection with no appointments as AppointmentsSource.

This is the output I see:

Airline 0

  •      Segregation 0
  •     Segregation 1
  •     Segregation 2

Airline 1

  •     Segregation 0
        Segregation 1
        Segregation 2

What I see is that segregations are repeated for each Airline. And Both Airline and Segregation group headers template have the same Style and template applied to them.

However, I have a case where, for example, Airline 0 might have Segregation 3 and 4, whereas Airline 1 may have Segregation 5 and 6. I am trying to achieve this grouping:
Airline 0
     Segregation 0
    Segregation 1
    Segregation 2

Airline 1
    Segregation 3
    Segregation 4
    Segregation 5

Question 1: Can I achieve the above custom grouping behaviour? I was not able to find an example for it.

Question 2: If the above behaviour is possible, Can I have different templates for Airline and Segregation?

I hope I was able to explain my problem clearly. Looking forward to your reply.

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 14 May 2018, 11:01 AM
Hi Rinku,

In case I am understanding your requirement correctly, you can use the approach demonstrated in the Custom grouping WPF Demo. Can you please take a look at it?

I hope it helps.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Rinku
Top achievements
Rank 1
answered on 15 May 2018, 11:31 AM

Hi Stefan,

Thank you for answering. 

The problem I am having is that each group have the same subgroup resources repeated in them. I needed the SubGroupsFilter implementation. Your answer me to the WPF demo example for the Filter Sub-group headers.

SubGroupsFilter Link

I will tweak the example to get the I desire. Thank you for the help.

0
Stefan
Telerik team
answered on 16 May 2018, 03:37 PM
Hi Rinku,

Thanks for the update.

I am happy to hear that you have found a helpful example in our demos.

All the best,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ScheduleView
Asked by
Rinku
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Rinku
Top achievements
Rank 1
Share this question
or