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
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
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
Hi,
Just wondering if there is any update on this issue?
Thanks
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
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
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
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
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
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