Hide Week Number

17 posts, 0 answers
  1. Tim
    Tim avatar
    3 posts
    Member since:
    Apr 2007

    Posted 18 Dec 2008 Link to this post

    How do I hide the week number for the RadDatePicker WPF control?
  2. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 20 Dec 2008 Link to this post

    Hi Tim,

    Currently we don't support this feature, we will plan to include it in one of our future releases.

    Best wishes,
    Boyan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Owen
    Owen avatar
    7 posts
    Member since:
    Apr 2009

    Posted 01 Apr 2009 Link to this post

    Are there plans to include this in the near future?  This is a rather important thing for us to be able to do.
  5. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 02 Apr 2009 Link to this post

    Hi Owen,

    Currently there is no property that can hide the week numbers, but you can edit the template and hide them from there. I have done that for you:

    <Grid> 
        <Grid.Resources> 
            <SolidColorBrush x:Key="Header2ForegroundBrush" Color="#FF000000" /> 
            <SolidColorBrush x:Key="RadCalendarBorderLine" Color="#FF9199a4" /> 
        </Grid.Resources> 
     
        <telerik:RadDatePicker VerticalAlignment="Center" 
                HorizontalAlignment="Center">  
            <telerik:RadDatePicker.MonthViewStyle> 
                <Style TargetType="calendar:CalendarView">  
                    <Setter Property="Template">  
                        <Setter.Value> 
                            <ControlTemplate TargetType="calendar:CalendarView">  
                                <Grid> 
                                    <Grid.RowDefinitions> 
                                        <RowDefinition Height="Auto" /> 
                                        <RowDefinition Height="*" /> 
                                    </Grid.RowDefinitions> 
                                    <ContentControl  
                                            Visibility="{TemplateBinding HeaderVisibility}" 
                                            Content="{TemplateBinding Header}" 
                                            Foreground="{StaticResource Header2ForegroundBrush}" 
                                            TextBlock.TextAlignment="Center" 
                                            Margin="0 2 0 2" /> 
     
                                    <!--Alternate rows and highlight --> 
                                    <Grid Grid.Row="1">  
                                        <Grid.RowDefinitions> 
                                            <RowDefinition Height="*" /> 
                                            <RowDefinition Height="6*" /> 
                                        </Grid.RowDefinitions> 
     
                                        <Border  
                                                BorderBrush="{StaticResource RadCalendarBorderLine}" 
                                                BorderThickness="0 0 0 1" 
                                                Background="#D2D4DA" /> 
                                    </Grid> 
                                    <ItemsPresenter Grid.Row="1" /> 
                                </Grid> 
                            </ControlTemplate> 
                        </Setter.Value> 
                    </Setter> 
                </Style> 
            </telerik:RadDatePicker.MonthViewStyle> 
            <telerik:RadDatePicker.MonthViewPanel> 
                <ItemsPanelTemplate> 
                    <primitives:RadUniformGrid Columns="8" Rows="7" 
                            FirstColumn="1" HideFirstColumn="True" /> 
                </ItemsPanelTemplate> 
            </telerik:RadDatePicker.MonthViewPanel> 
        </telerik:RadDatePicker> 
    </Grid> 


    You can of course extract this in a style and use it where needed. Here is the end result:



    Hopefully this is what you need,

    Best wishes,
    Miroslav
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  6. Ariel
    Ariel avatar
    2 posts
    Member since:
    Apr 2009

    Posted 23 Jun 2009 Link to this post

    Hi,

    I'm having the same problem, where can I find that template?.
  7. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 24 Jun 2009 Link to this post

    Hi Ariel,

    You have to edit the template of the DatePicker in Blend Studio and then make the changes to the template as Miroslav showed below.

    I think this will help. If you need more help please let me know.

    Sincerely yours,
    Boyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Jane
    Jane avatar
    16 posts
    Member since:
    Jun 2009

    Posted 18 Jan 2010 Link to this post

    <telerik:RadDatePicker.MonthViewPanel>    
                <ItemsPanelTemplate>    
                    <primitives:RadUniformGrid Columns="8" Rows="7"    
                            FirstColumn="1" HideFirstColumn="True" />    
                </ItemsPanelTemplate>    
    </telerik:RadDatePicker.MonthViewPanel>    
     
    Hi

    We like to hide the weeek column as well. So we copy the above code in the xaml file.
    However, it complaint about the "primitives: RadUniformGrid"
    "primitives' is an undeclared namespace.
    Which assembly we should include to solve this problem?
    thx!
    Jane
  9. Jane
    Jane avatar
    16 posts
    Member since:
    Jun 2009

    Posted 19 Jan 2010 Link to this post

    we found that we need add the following name space in the xaml file.
    xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls" 
     

     

     

     

  10. Jane
    Jane avatar
    16 posts
    Member since:
    Jun 2009

    Posted 19 Jan 2010 Link to this post

    we have following the above code to hide week number column.
    However, we notice that after hiding the week number column, the first column (Sunday) is still keep as the deep gray color as the week number column. See the attachment.
    Is there a way we can make the Sunday column as the rest of weekday column color (light gray).
    thx!
    jane
  11. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 21 Jan 2010 Link to this post

    Hello Jane,

    As a better way to hide the week number is to set the AreWeekNumbersVisible property to false:
    <telerik:RadDatePicker HorizontalAlignment="Center" VerticalAlignment="Center"
                   AreWeekNumbersVisible="False" AreWeekNamesVisible="True" />

    All the best,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  12. Ramin
    Ramin avatar
    30 posts
    Member since:
    Sep 2010

    Posted 17 Sep 2010 Link to this post

    I am getting error "Type calendar:CalendarView was not found" in:
    <Style TargetType="calendar:CalendarView">
  13. George
    Admin
    George avatar
    1332 posts

    Posted 21 Sep 2010 Link to this post

    Hi Ramin,

    Thank you for contacting us.

    Could you please specify where do you get this error?

    We introduced our new RadDateTimePicker control this Q2 release and we made some required changes with date and time pickers. We tried to make as few changes to the controls as possible. Now RadDatePicker and RadTimePicker controls inherit RadDateTimePicker.

    AreWeekNumbersVisible property is now Obsolete. If you want to disable the week numbers, for example, you could accomplish this by setting a Style for CalendarStyle property and in this style you could set the value for the property AreWeekNumbersVisible to False.

    I hope this helps. I will be glad to assist you further.

    Kind regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  14. Ramin
    Ramin avatar
    30 posts
    Member since:
    Sep 2010

    Posted 21 Sep 2010 Link to this post

    Hi George,

    In RadDateTimePicker I need to hide Week numbers and I don't know how.
    Can you show me how I can set CalendarStyle?
    A code example will be very helpful

    Thanks,
    Ramin
  15. George
    Admin
    George avatar
    1332 posts

    Posted 23 Sep 2010 Link to this post

    Hi Ramin,

    Attached you can find the sample. I hope this helps! 

    Best wishes,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  16. Ramin
    Ramin avatar
    30 posts
    Member since:
    Sep 2010

    Posted 28 Sep 2010 Link to this post

    Hi George,
    That's exactly what I wanted.
    Thanks
    Ramin
  17. Matthew
    Matthew avatar
    2 posts
    Member since:
    Oct 2007

    Posted 01 Mar 2012 Link to this post

    This seems to work really well.

    <style type="text/css">
        .rcViewSel,
        .rcRow th
         { display: none;}
    </style>
  18. Jong
    Jong avatar
    1 posts
    Member since:
    Jun 2016

    Posted 30 Jun in reply to Matthew Link to this post

    NICE...this solution nailed it.. very simple yet very effective...
Back to Top
UI for WPF is Visual Studio 2017 Ready