how to change DatePicker Monthview's Header

6 posts, 0 answers
  1. Hanif
    Hanif avatar
    3 posts
    Member since:
    Jun 2009

    Posted 01 Jul 2009 Link to this post

    Hi, there

    I want to change Datepicker's MonthView Header,
     I am trying to change background of contentcontrol but it doesn't make any changes to my control. I could find proper property to change. If someone could help me ? Thanks in advance.

     <RadInput:RadDatePicker.MonthViewStyle>
                        <Style TargetType="RadControl:CalendarView">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="RadControl:CalendarView" >
                                            <Grid Background="White">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="*" />
                                            </Grid.RowDefinitions>
                                            <ContentControl  Visibility="{TemplateBinding HeaderVisibility}" 
                                                Content="{TemplateBinding Header}" 
                                                Foreground="Black"  
                                                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="Black" 
                                                    BorderThickness="0 0 0 1" 
                                                    Background="Blue" />
                                            </Grid>
                                            <ItemsPresenter Grid.Row="1"  />
                                            </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </RadInput:RadDatePicker.MonthViewStyle>

  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 07 Jul 2009 Link to this post

    Hi Hanif,

    The problem here is that the ViewsHeaderVisibility property is set to Collapsed by default. So to see the changes you need to set this property to visible. Let us know of you need some more input about this.

    Greetings,
    Kaloyan
    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Hanif
    Hanif avatar
    3 posts
    Member since:
    Jun 2009

    Posted 09 Jul 2009 Link to this post

    Hi, by setting ViewsHeaderVisibility to true It shows 2 headers. I can hid the first header with HeaderVisibility but I want to change the first one/ top one header's background and font as well. Could you please show me work around ?

    Thanks,

    Hanif
  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 14 Jul 2009 Link to this post

    Hello Hanif,

    Attached, you can find a project demonstrating the way you can use to achieve the task. The best approach when editing some control parts or colors is to use an Expression Blend. The attached project also includes a screenshot on the Expression Blend project that shows you the exact row of this header element.

    Best wishes,
    Kaloyan
    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.
  6. bhavin patel
    bhavin patel avatar
    24 posts
    Member since:
    Jun 2005

    Posted 17 Nov 2009 Link to this post

    Hello,

       We are using datepicker control for our application but now client wants today's date should be display at the bottom when you open dtPicker. 

       How can i display today's date inside datepicker ?

    I really appreciate your help.

    Bhavin Patel
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 23 Nov 2009 Link to this post

    Hello Bhanif,

    First of all I want to apologize for the late response.

    I edited the example Kaloyan sent you to show the current date and time. I added a new ViewModel class that has a single property called Now and bound a TextBlock element in the ControlTemplate of the RadCalendar control to this property. Please find the attached project.

    Greetings,
    Miroslav Nedyalkov
    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready