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

Is there a way to make the 'TimeRulerMonthViewItemStyle' height shorter?

4 Answers 81 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ramski
Top achievements
Rank 1
Ramski asked on 27 Mar 2012, 07:33 AM
I'm using a scheduleview that shows just a few data on every month, the problem is it makes a lot of white space because of the scheduleview's height.
Is there a way to make the group items height shorter? mainly the 'TimeRulerMonthViewItemStyle'. considering it wont break the calendar. 

4 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 27 Mar 2012, 08:30 AM
Hello Ramil,

You can change the height of the slots in MonthView, as suggested in this thread. Use the GroupHeaderStyleSelector for this purpose. Here you can find more details on the selector and implementing it in your project.

Hope this helps.

Regards,
Dani
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Ramski
Top achievements
Rank 1
answered on 28 Mar 2012, 12:52 AM
Hi Dani,

Thanks for the reply, I tried changing the MaxHeight of MonthViewBottomLevelWeekGroupStyle but it broke the layout of the calendar. Also tried using MinHeight instead, like the one you said in the other post but it didn't work. Any other way to change the height property for the MonthViewBottomLevelWeekGroupStyle?

Thanks,
Ramil
0
Dani
Telerik team
answered on 03 Apr 2012, 12:17 PM
Hello Ramil,

Since width or height of the month view week group headers is equally divided, group headers cannot be set a fixed width or height, but can be manipulated through MinHeight and MaxHeight (or respective width) properties.

Well, changing the MinHeight or MaxHeight in your case is probably not working because the content of one or more of the group headers does not allow it, i.e. the text of some of the group headers cannot be minimized any more than it is now. This content is presented by a ContentPresenter which does not support TextTrimming so basically you cannot shrink the group headers any more.

What you can do is remove the rotation of the vertical group headers. The result will look something similar to the attached 01.png and 02.png. This is done by removing the LayoutTransformControl in the VerticalTemplate of the GroupHeaderTemplateSelector and leaving only a single ContentPresenter, instead:
<local:GroupHeaderTemplateSelector.VerticalTemplate>
            <DataTemplate>
                <ContentPresenter Content="{Binding FormattedName}" Width="120" />
            </DataTemplate>
</local:GroupHeaderTemplateSelector.VerticalTemplate>

Something else you can do is simply remove the week group headers by setting Height and Width to 0:
<Style x:Key="MonthViewBottomLevelWeekGroupStyle" TargetType="local:GroupHeader" BasedOn="{StaticResource GroupHeaderBaseStyle}">
            <Setter Property="Margin" Value="0 0 0 -1" />
            <Setter Property="Height" Value="0" />
            <Setter Property="Width" Value="0" />
</Style>

Result on the attached 03.png. Of course, that is if your scenario allows it.

I hope this info will help in your case.

Regards,
Dani
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Dani
Telerik team
answered on 03 Apr 2012, 12:21 PM
Hi,

And here are the screenshots.

Regards,
Dani
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
ScheduleView
Asked by
Ramski
Top achievements
Rank 1
Answers by
Dani
Telerik team
Ramski
Top achievements
Rank 1
Share this question
or