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

Inherited/Custom DatePicker

3 Answers 134 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Johannes
Top achievements
Rank 1
Johannes asked on 05 Feb 2015, 04:33 PM
I want to extend RadDatePicker. I've created this class:

public class CustomRadDatePicker : RadDatePicker
{
    // no code yet
}


As you can see there is absolutely no code yet in this class but when adding CustomRadDatePicker instead of RadDatePicker in XAML there is no control displayed at design time and runtime. I've extended many other of your controls and there were no Problems so can you please tell me what's wrong here? I need to extend RadDatePicker.

3 Answers, 1 is accepted

Sort by
0
Johannes
Top achievements
Rank 1
answered on 05 Feb 2015, 05:03 PM
Ok I can answer that by myself :)

It's important to set the styling of the new custom control via code or in App.xaml. I didn't do that for my other controls like CustomRadGridView but they all were displayed correctly. In this case it seems there must be a style set.
0
Accepted
Kalin
Telerik team
answered on 06 Feb 2015, 07:58 AM
Hi Johannes,

I'm glad you managed to resolve the issue. Please note that when using Implicit Styles and inheriting from any control you would need to define a custom Style with TargetType the new control and BasedOn the default Style of our control.

If you have any other questions or concerns, please do not hesitate to contact us.

Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Johannes
Top achievements
Rank 1
answered on 06 Feb 2015, 08:40 AM
Indeed I am using Implicit Styles so now I've added styles for all my custom controls, for example:

<Style TargetType="v:CustomRadDatePicker" BasedOn="{StaticResource RadDateTimePickerStyle}" />


Thanks for your help.
Tags
DatePicker
Asked by
Johannes
Top achievements
Rank 1
Answers by
Johannes
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or