This is a migrated thread and some comments may be shown as answers.
Is it possible to hide the TimePicker header?
5 Answers 61 Views
This is a migrated thread and some comments may be shown as answers.
Geoff Hardy
Top achievements
Rank 1
Geoff Hardy asked on 06 Jul 2010, 11:34 PM
By default, when you use the RadTimePicker control, it has a header showing "TimePicker" at the top of the drop-down list of items. This header is not particularly useful and I would like to hide it. If I set the HeaderContent property to an empty string, or null, the header control still appears with no text but is approximately 6 pixels high.

Is there a simple way to get rid of this header?

5 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 09 Jul 2010, 10:00 AM
Hi Geoff,

Thank you for contacting us.

You can easily edit the template of the TimePicker in Expression Blend. Just drop a TimePicker control in the design surface, right-click it and choose from the menu Edit Template->Edti a Copy. Blend will generate for you all the styles and templates of the TimePicker. Then find the ClockElement right-click it and again choose from the menu Edit Template->Edti a Copy. Now you have the template of the ClockElement and you will be able to remove the Header.
Please find the attached project in which the above mentioned steps are performed. Please mind for the "NOTE:" comment which indicate the place where changes have been made.

If you need further assistance please do not hesitate to contact us again.

All the best,
Konstantina
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
0
Geoff Hardy
Top achievements
Rank 1
answered on 17 Mar 2011, 06:13 PM
I was trying to change the header using version 2011.1 and so I went to look at the project that was attached, and strangely, it was blank. There didn't seem to be any RadTimePickers at all!
0
Konstantina
Telerik team
answered on 18 Mar 2011, 12:02 PM
Hello Geoff,

Sorry about the missing TimePicker into the project.

Attached I am sending you new project with removed header from the template of the TimePicker. However, you have a second option for removing only the text from the header, by setting the ClockStyle of the TimePicker, for example:

<telerik:RadTimePicker HorizontalAlignment="Center" VerticalAlignment="Center">
                <telerik:RadTimePicker.ClockStyle>
                    <Style TargetType="telerik:RadClock">
                        <Setter Property="telerik:LocalizationManager.ResourceKey" Value="{x:Null}" />
                        <Setter Property="Header" Value="{x:Null}" />
                    </Style>
                </telerik:RadTimePicker.ClockStyle>
            </telerik:RadTimePicker>

Hope this information helps. Please let us know if you have further questions.

All the best,
Konstantina
the Telerik team
0
James
Top achievements
Rank 1
answered on 18 Mar 2011, 08:25 PM
Thanks,

Here is the code if you just want to change the header text (with custom styles for RadTimePicker and RadClock):

<InputControls:RadTimePicker Style="{StaticResource RadTimePickerStyle}">
    <InputControls:RadTimePicker.ClockStyle>
        <Style TargetType="telerik:RadClock" BasedOn="{StaticResource RadClockStyle}">
            <Setter Property="telerik:LocalizationManager.ResourceKey" Value="{x:Null}" />
            <Setter Property="Header" Value="My custom header text" />
        </Style>
    </InputControls:RadTimePicker.ClockStyle>
</InputControls:RadTimePicker>

Rgds,

James
0
Kaloyan
Telerik team
answered on 19 Mar 2011, 12:22 PM
Hi James,

This is the correct solution.

Kind regards,
Kaloyan
the Telerik team
Asked by
Geoff Hardy
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Geoff Hardy
Top achievements
Rank 1
James
Top achievements
Rank 1
Kaloyan
Telerik team
Share this question
or