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

how to change DatePicker Monthview's Header

5 Answers 71 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Hanif
Top achievements
Rank 1
Hanif asked on 02 Jul 2009, 03:40 AM
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>

5 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 07 Jul 2009, 12:48 PM
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.
0
Hanif
Top achievements
Rank 1
answered on 09 Jul 2009, 05:00 AM
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
0
Kaloyan
Telerik team
answered on 14 Jul 2009, 11:35 AM
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.
0
Bhavin
Top achievements
Rank 1
answered on 17 Nov 2009, 09:23 PM
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
0
Miroslav Nedyalkov
Telerik team
answered on 23 Nov 2009, 03:07 PM
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.
Tags
Calendar
Asked by
Hanif
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Hanif
Top achievements
Rank 1
Bhavin
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or