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

How to hide group header (bottom level)

3 Answers 356 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Cheau-Long
Top achievements
Rank 1
Cheau-Long asked on 19 Aug 2011, 05:46 PM
Hi Telerik:
How can I hide the entire group header column (the bottom level only) as pointed in the screenshot below? I have attached xaml for your reference.

Thanks,
Cheau





        <!-- ScheduleView -->

        <telerik:RadScheduleView x:Name="scheduleView"

                                Grid.Row="2"                                

                                MaxTimeRulerExtent="500"

                                AppointmentsSource="{Binding Tasks, Mode=TwoWay}"

                                ResourceTypesSource="{Binding ScheduleOptionList, Mode=TwoWay}"

                                GroupDescriptionsSource="{Binding GroupCollection, Mode=TwoWay}"

                                CurrentDate="{Binding DefaultDate}"                                              

                                NavigationHeaderVisibility="Collapsed"                               

                                AllowDrop="True"

                                SnapAppointments="True"  

                                MinAppointmentWidth="22"

                                Height="Auto">

 

            <telerik:RadScheduleView.DragDropBehavior>

                <local:ScheduleDragDropBehavior/>

            </telerik:RadScheduleView.DragDropBehavior>

 

            <telerik:RadScheduleView.AppointmentItemContentTemplate>

                <DataTemplate>

                    <StackPanel>

                        <TextBlock Text="{Binding Subject}"  FontWeight="Bold"/>

                        <StackPanel Orientation="Horizontal">

                            <TextBlock Text="{Binding Start, StringFormat={}{0:H:mm}}"/>

                            <TextBlock Text=" - "/>

                            <TextBlock Text="{Binding End, StringFormat={}{0:H:mm}}"/>

                        </StackPanel>

                    </StackPanel>

                </DataTemplate>

            </telerik:RadScheduleView.AppointmentItemContentTemplate>

 

            <telerik:RadScheduleView.ActiveViewDefinition>

                <telerik:DayViewDefinition Orientation="Horizontal" FirstDayOfWeek="Monday" TimerulerMajorTickStringFormat="{}{0:HH}"

                                            MinorTickLength="1h"  MajorTickLength="1h" MinTimeRulerExtent="700" GroupHeaderDateStringFormat="{}{0:MM/dd}" />

               

            </telerik:RadScheduleView.ActiveViewDefinition>                      

 

        </telerik:RadScheduleView>

 

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 26 Aug 2011, 09:41 AM
Hi Cheau-Long,

I would suggest to use GroupHeaderStyleSelector and set Visibility prpoperty to VerticalBottomLevelGroupHeaderStyle and VerticalBottomLevelTodayGroupHeaderStyle like this:

<Style x:Key="VerticalBottomLevelGroupHeaderStyle" TargetType="local:GroupHeader">
    <Style.BasedOn>
    <Style TargetType="telerik:GroupHeader">
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="Height" Value="0" />
    </Style>
    </Style.BasedOn>
</Style>
<Style x:Key="VerticalBottomLevelTodayGroupHeaderStyle" TargetType="local:GroupHeader">       
    <Style.BasedOn>
        <Style TargetType="telerik:GroupHeader">              
            <Setter Property="Visibility" Value="Collapsed"/>
            <Setter Property="Height" Value="0" />
        </Style>
    </Style.BasedOn>
</Style>

Please check this help article for more details.

Best wishes,
Yana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Andrei
Top achievements
Rank 1
answered on 23 Mar 2012, 04:47 PM
Hello,

    I needed to do the same thing ( hide the vertical headers ) but setting visibility to Collapsed hiddes indeed the VerticalBottomGroupHeader but it removes also the lines(borders) of/between each headers ( please see attached image ). 
    How can I avoid this? To hide the VerticalBottomGroupHeader but keep the groupHeaders line(borders).

Kindly regards,
Andrei
<UserControl x:Class="TimeBar.MainPage"
        xmlns:scheduleView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
        xmlns:local="clr-namespace:TimeBar"
        xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
        xmlns:qsf="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
        xmlns:example="clr-namespace:TimeBar" mc:Ignorable="d" d:DesignWidth="600"
        d:DesignHeight="400">
 
    <UserControl.Resources>
        <example:ViewModel  x:Key="ViewModel" />
        <Style x:Key="VerticalBottomLevelGroupHeaderStyle" TargetType="telerik:GroupHeader">
            <Style.BasedOn>
                <Style TargetType="telerik:GroupHeader">
                    <Setter Property="Visibility" Value="Visible"/>
                    <Setter Property="Height" Value="0" />
                </Style>
            </Style.BasedOn>
        </Style>
 
        <Style x:Key="VerticalBottomLevelTodayGroupHeaderStyle" TargetType="telerik:GroupHeader">
            <Style.BasedOn>
                <Style TargetType="telerik:GroupHeader">
                    <Setter Property="Visibility" Value="Visible"/>
                    <Setter Property="Height" Value="0" />
                </Style>
            </Style.BasedOn>
        </Style>
 
        <telerik:OrientedGroupHeaderStyleSelector x:Key="GroupHeaderStyleSelector"
            VerticalBottomLevelStyle="{StaticResource VerticalBottomLevelGroupHeaderStyle}"
            VerticalTodayBottomLevelStyle="{StaticResource VerticalBottomLevelTodayGroupHeaderStyle}">
        </telerik:OrientedGroupHeaderStyleSelector>
 
    </UserControl.Resources>
 
    <telerikQuickStart:QuickStart.ExampleHeader>
        <TextBlock Text="Appointments filtering" Margin="8" />
    </telerikQuickStart:QuickStart.ExampleHeader>
 
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
         
        <StackPanel Orientation="Vertical" DataContext="{StaticResource ViewModel}" Grid.Column="0">
            <TextBlock Text="Customer/Product " Margin="8" />
            <telerik:RadComboBox ItemsSource="{Binding ResourcesCustomerPromotions}"
                                     SelectedItem="{Binding SelectedCustomerPromotion, Mode=TwoWay}"
                                 SelectionChanged="RadComboBox_SelectionChanged"
                                     EmptyText="All"
                                     ClearSelectionButtonVisibility="Visible"
                                     ClearSelectionButtonContent="Show all" />
        </StackPanel>
 
        <telerik:RadScheduleView x:Name="MainSchedule" Grid.Column="1"
                                 DataContext="{StaticResource ViewModel}"
                                 AppointmentsSource="{Binding SelectedAppointments}"
                                 ResourceTypesSource="{Binding ResourceTypes}"
                                 MinAppointmentHeight="10"
                                 NavigationHeaderVisibility="Collapsed"
                                 GroupHeaderStyleSelector="{StaticResource GroupHeaderStyleSelector}">
 
                <telerik:RadScheduleView.GroupDescriptionsSource>
                    <telerik:GroupDescriptionCollection>
                        <scheduleView:DateGroupDescription />
                        <scheduleView:ResourceGroupDescription ResourceType="CustomerPromotion" />
                    </telerik:GroupDescriptionCollection>
                </telerik:RadScheduleView.GroupDescriptionsSource>
             
            <telerik:RadScheduleView.ActiveViewDefinition >
                <telerik:TimelineViewDefinition MinTimeRulerExtent="1" MaxTimeRulerExtent="Infinity" ShowTimeRuler="False"
                            StretchAppointments="False" StretchGroupHeaders="False" VisibleDays="90"  MajorTickLength="1day"
                            GroupTickLength="1day" TimerulerMajorTickStringFormat="{}{0:d}" MinorTickLength="1day">
                </telerik:TimelineViewDefinition>
            </telerik:RadScheduleView.ActiveViewDefinition>
             
            <scheduleView:RadScheduleView.ViewDefinitions>
                <telerik:TimelineViewDefinition  MinTimeRulerExtent="16800"
                    MaxTimeRulerExtent="Infinity"  
                    VisibleDays="150"
                    StretchAppointments="False"
                    StretchGroupHeaders="False"
                    MinorTickLength="1day"
                    MajorTickLength="1day">
                    <telerik:TimelineViewDefinition.GroupTickLength>
                        <local:OneWeekTick/>
                    </telerik:TimelineViewDefinition.GroupTickLength>
                </telerik:TimelineViewDefinition>
            </scheduleView:RadScheduleView.ViewDefinitions>          
 
        </telerik:RadScheduleView>
    </Grid>
</UserControl>
0
Yana
Telerik team
answered on 28 Mar 2012, 02:01 PM
Hello Andrei,

In this case you should set GroupHeaderContentTemplateSelector instead of GroupHeaderStyleSelector. Here is the needed code:

<telerik:GroupHeaderTemplateSelector x:Key="GroupHeaderContentTemplateSelector">
    <telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding FormattedName}" Height="0" Margin="0" />
        </DataTemplate>
    </telerik:GroupHeaderTemplateSelector.HorizontalTemplate>
    <telerik:GroupHeaderTemplateSelector.VerticalTemplate>
        <DataTemplate>
            <ContentPresenter Content="{Binding FormattedName}" Margin="0" Height="0" VerticalAlignment="Top">
                <ContentPresenter.LayoutTransform>
                    <RotateTransform Angle="-90" />
                </ContentPresenter.LayoutTransform>
            </ContentPresenter>
        </DataTemplate>
    </telerik:GroupHeaderTemplateSelector.VerticalTemplate>
</telerik:GroupHeaderTemplateSelector>

and the set GroupHeaderContentTemplateSelector to the ScheduleView:

<telerik:RadScheduleView x:Name="MainSchedule" Grid.Column="1"
    DataContext="{StaticResource ViewModel}"
    AppointmentsSource="{Binding SelectedAppointments}"
    ResourceTypesSource="{Binding ResourceTypes}"
    MinAppointmentHeight="10"
    NavigationHeaderVisibility="Collapsed"                             
    GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderContentTemplateSelector}">

Hope this helps.

All the best,
Yana
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
Cheau-Long
Top achievements
Rank 1
Answers by
Yana
Telerik team
Andrei
Top achievements
Rank 1
Share this question
or