Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
How to Add/Show Header Text in XamDayView
posted

Hi,

i had tried lots of time but i am unable to add Header Text in XamdayView.

also there is no help on internet at all.

Please help.

Previously i had posted a question but it seems infragistics guys are very busy, and unable to sort out problems of there customers.

 

Parents Reply
  • 54937
    Offline posted in reply to nguyen

    This isn't really related to the original question posed in this forum thread so it would be best to start a different one next time.

    The easiest way to help find an answer to questions such as this is to get Snoop and look at the element tree to see where those elements are. In this case there are several ScheduleDateTimePresenter instances that are providing those visuals. These exist within the DayViewDayHeader element so if you do not want those in there then you would retemplate the DayViewDayHeader and remove or collapse those elements.

    The best place to start with creating custom templates is to take a copy of the existing one from the DefaultStyles directory (e.g. C:\Program Files\Infragistics\NetAdvantage 2011.1\WPF\DefaultStyles). In this case that template looks like the following:

        <Style TargetType="igSchedulePrim:DayViewDayHeader">
         <Setter Property="Template">
          <Setter.Value>
           <ControlTemplate TargetType="igSchedulePrim:DayViewDayHeader">
            <Border BorderBrush="{TemplateBinding ComputedBorderBrush}"
              BorderThickness="{TemplateBinding ComputedBorderThickness}"
              Background="{TemplateBinding ComputedBackground}"
              Padding="{TemplateBinding Padding}"
              igPrim:XamlHelper.SnapsToDevicePixels="True">
             <Grid igPrim:XamlHelper.SnapsToDevicePixels="{TemplateBinding igPrim:XamlHelper.SnapsToDevicePixels}" >
              <Grid.ColumnDefinitions>
               <ColumnDefinition Width="Auto"/>
               <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <igSchedulePrim:ScheduleDateTimePresenter HorizontalAlignment="Left" FormatType="DayOfMonthNumber" DateTime="{Binding DateTime, RelativeSource={RelativeSource TemplatedParent}}" FontWeight="Bold" Foreground="{TemplateBinding ComputedForeground}"/>
              <igPrim:BestFitPanel x:Name="FullDayName" Grid.Column="1" HorizontalAlignment="Center" Margin="0,0,7,0">
               <igSchedulePrim:ScheduleDateTimePresenter FormatType="DayOfWeek" DateTime="{Binding DateTime, RelativeSource={RelativeSource TemplatedParent}}" Foreground="{TemplateBinding ComputedForeground}"/>
               <igSchedulePrim:ScheduleDateTimePresenter FormatType="ShortDayOfWeek" DateTime="{Binding DateTime, RelativeSource={RelativeSource TemplatedParent}}" Foreground="{TemplateBinding ComputedForeground}"/>
               <igSchedulePrim:ScheduleDateTimePresenter FormatType="ShortestDayOfWeek" DateTime="{Binding DateTime, RelativeSource={RelativeSource TemplatedParent}}" Foreground="{TemplateBinding ComputedForeground}"/>
              </igPrim:BestFitPanel>
             </Grid>
            </Border>
           </ControlTemplate>
          </Setter.Value>
         </Setter>
        </Style>   

    And that requires some namespace mappings (also taken from the same xaml file where the template was taken):

           xmlns:ig="http://schemas.infragistics.com/xaml"
           xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives"
           xmlns:igSchedulePrim="http://schemas.infragistics.com/xaml/primitives"

    So you could remove the Grid within the Border. Note since there would be no content to provide any height you may want to add a setter for the MinHeight or put something (like a textblock) within the template in place of the grid.

Children