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

WeekViewDefinition Group Size Problem

9 Answers 66 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Veteran
Anthony asked on 13 May 2015, 02:15 AM

Hi,

 I have recently added filtering of resources on my WeekViewDefinition view.

 When there are 8 resources the layout looks fine, each day of the week for each resource is a good size. See Good.jpg

 If I filter one of the resources, each day of the week gets resized and becomes way too large. See Bad.jpg.

 Any help would be appreciated as the view is unusable when the days become so large.

 Thanks

Anthony

9 Answers, 1 is accepted

Sort by
0
Anthony
Top achievements
Rank 1
Veteran
answered on 13 May 2015, 05:51 AM

Hi,

I forgot to mention that I am using a GroupHeaderContentTemplateSelector.

I think the issue has something to with the wrong container being used between the date group and resource group.

I had a width set of 600 on my resource group, which if accidentally used in some way on the date group would explain the stretching of the days.

I also get a binding error "BindingExpression path error: 'DisplayName' property not found on 'object' ''DateTime' (HashCode=-2043258476)'. BindingExpression:Path=Name.DisplayName; DataItem='GroupHeaderProxy' (HashCode=33854279); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')"

That does not make sense because the GroupHeaderContentTemplateSelector should provide the following template when the group is a date. Note that the template does not use "DisplayName" anywhere, that is only used in the template for the resource group. Again this indicates the use of the wrong template.

                <DataTemplate>
                    <Grid>
                        <TextBlock Margin="6,0,0,0" FontWeight="Bold" Text="{Binding Name, StringFormat=dd}"/>
                        <TextBlock Margin="0,0,6,0" Text="{Binding Name, StringFormat=ddd}" TextAlignment="Right"/>
                    </Grid>

Thanks

Anthony

 

 

0
Kalin
Telerik team
answered on 14 May 2015, 08:40 AM
Hi Anthony,

Can you please share some more sample code (the GroupHeaderContentTemplateSelector and the GroupFilter code) so we can test the explained scenario? Also have you modified the GroupHeader styles and which version of the control are you using?

I'm looking forward to hearing from you.

Regards,
Kalin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Anthony
Top achievements
Rank 1
Veteran
answered on 03 Jun 2015, 10:50 PM

Hi,

Just wondering if there is any update on this issue?

Thanks

Anthony

0
Kalin
Telerik team
answered on 05 Jun 2015, 06:43 AM
Hi Anthony,

We would need some more details in order to be able to provide you a possible solution for this issue. Can you please share some more details - the GroupHeaderContentTemplateSelector and the GroupFilter code would be good starting point. Also have you modified the GroupHeader styles and which version of the control are you using? If you are able to provide sample runnable project that would be really helpful.

I'm looking forward to hearing from you.

Regards,
Kalin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Anthony
Top achievements
Rank 1
Veteran
answered on 05 Jun 2015, 07:15 AM

Hi,

I have already provided that information in a previous post. The only thing I didn't provide was a runnable solution.

This issue is very easy to reproduce, just set the width of a resource header to be 1000 and then watch as the date header template grows larger when the containers are reused.

Thanks

Anthony

0
Kalin
Telerik team
answered on 05 Jun 2015, 12:37 PM
Hello Anthony,

First of all I would like to apologize for the misunderstanding and missing your previous post. However I tested the provided code snippets in a sample project based on them and I was not able to reproduce the described issue. Please find the sample project attached, test it on your side and let us know if anything additional needs to be done. Also you can try to use Grid instead of StackPanel in the GroupHeader template and see  if this solves the issue.

I'm looking forward to hearing from you.

Regards,
Kalin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Anthony
Top achievements
Rank 1
Veteran
answered on 09 Jun 2015, 12:33 AM

Hi,

Using your sample project I have not been able to reproduce the error in the same place, however I have produced a very similar error where the templates are being mixed up.

Have a look at the screenshot which shows the last two resource groups being mixed up.

I have attached the source code which will reproduce this every time. (Had to put .jpg extension on it to attach it)

Thanks

Anthony

0
Kalin
Telerik team
answered on 10 Jun 2015, 08:02 AM
Hi Anthony,

The issue in the sample project is that you don't have any Templates defined for the DayViewDefitinition and in this case the Selector calls the base.SelectTemplate method which returns null and this causes the issue. What I can suggest you would be instead of calling the base method would be to implement default vertical and horizontal templates and to return them at the end of the selector. Check the attached sample project which demonstrates the exact approach.

Hope this helps.

Regards,
Kalin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Anthony
Top achievements
Rank 1
Veteran
answered on 10 Jun 2015, 09:06 AM

Hi,

I understand what you are saying, it's just a bit strange that the group headers were fine for all of the resources except for the last 2.

I will keep trying to replicate my sizing issue in the sample project.

Thanks

Anthony

Tags
ScheduleView
Asked by
Anthony
Top achievements
Rank 1
Veteran
Answers by
Anthony
Top achievements
Rank 1
Veteran
Kalin
Telerik team
Share this question
or