Last appointment not visible in MonthView

4 posts, 1 answers
  1. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 12 Jan 2012 Link to this post

    Hi!

    We use the ScheduleView in a scheduler application.
    We use the MonthView to display how many appointments of a specific type that exist on each day.
    Therefore we have a different appointment source for the MonthView that always have 6 appointments each day, one for each type.

    We show them as small rectangles below each other with different colors and a number inside telling how many appointments of that specific type that exists on that day (see attached image).
    If no appointments of one type exists, it's hidden. As you can see in the image, there is only four rectangles. There are actually 6 but two are hidden.

    The problem is that when the ScheduleView is first loaded, the last (red) appointment is not displayed.
    I have tested to place a refresh button that will just set the appoinment source to null and back again, then all of them will be displayed, very strange. I can't seem to do this in code anywhere, it must be user initialized.

    As you can see in the image I have retemplated the MonntView, and removed the header for each day and also the button that will expand a day slot to show more appointments. I think it must be something with this button that is still present and hiding my last appointment. Becaus if I reduce the height of the appointments, they are all visible from the start. So there must be something hiding the last appointment.

    Any ideas?

    Here is my control template:
    <Style x:Key="TimeRulerMonthViewItemStyle" TargetType="local:TimeRulerMonthViewItem">
          <Setter Property="Foreground" Value="{StaticResource MonthViewTimeRulerItemForeground_Normal}" />
          <Setter Property="Margin" Value="0 -1 -1 1" />
          <Setter Property="Template">
              <Setter.Value>
                  <ControlTemplate TargetType="local:TimeRulerMonthViewItem">
                      <Grid>
                          <telerik:RadButton VerticalAlignment="Stretch" Padding="0" Style="{StaticResource GoToDayButtonStyle}" Command="local:RadScheduleViewCommands.SetDayViewMode" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.DateTime.Date}">
                              <StackPanel Orientation="Vertical" VerticalAlignment="Center" IsHitTestVisible="False">
                                  <TextBlock Text="{Binding Content.DateTime.Day, RelativeSource={RelativeSource TemplatedParent}}" Foreground="{StaticResource TextBrush}" Opacity="0.75" HorizontalAlignment="Center" FontSize="24" />
                                  <TextBlock Text="{Binding Content.DateTime, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DateTimeConverter}, ConverterParameter='MMMM'}" Foreground="{StaticResource TextBrush}" Opacity="0.75" HorizontalAlignment="Center" FontSize="10" Margin="0,-10,0,0" />
                              </StackPanel>
                          </telerik:RadButton>
                      </Grid>
                      <!--<Grid>
                          <telerik:RadButton Padding="0" VerticalAlignment="Top" Height="22" Style="{StaticResource GoToDayButtonStyle}" Command="local:RadScheduleViewCommands.SetDayViewMode" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.DateTime.Date}">
                              <ContentPresenter Margin="{TemplateBinding Padding}" />
                          </telerik:RadButton>
                          <telerik:RadToggleButton Visibility="{Binding ExpandButtonVisibility}" IsChecked="{Binding IsExpanded, Mode=TwoWay}" Style="{StaticResource ExpandMonthViewButtonStyle}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
                      </Grid>-->
                  </ControlTemplate>
              </Setter.Value>
          </Setter>
      </Style>


    Regards,
    Håkan






  2. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 12 Jan 2012 Link to this post

    I have reduced the MinHeight in MonthViewBottomLevelWeekGroupStyle from 112 to 85.
    If I set it back to 112, they are all displayed.
    How come? They should fit in 85, I mean, they do when I refresh..

    Regards,
    Håkan
  3. DevCraft banner
  4. Answer
    Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 17 Jan 2012 Link to this post

    Hello Håkan,

    You could try setting the Padding property of the MonthViewBottomLevelWeekGroupStyle and remove the bottom margin.

    Please let us know if that helped.

    All the best,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  5. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 18 Jan 2012 Link to this post

    Hi,

    I changed the bottom margin to 0, but it wasn't enough.
    I had to set it to -20, and then it worked.

    So it still seems to be something in the way, but I guess it's OK as long as it works...

    Regards,
    Håkan
Back to Top