Inherited/Custom DatePicker

4 posts, 1 answers
  1. Johannes
    Johannes avatar
    66 posts
    Member since:
    Dec 2012

    Posted 05 Feb 2015 Link to this post

    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.
  2. Johannes
    Johannes avatar
    66 posts
    Member since:
    Dec 2012

    Posted 05 Feb 2015 in reply to Johannes Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 06 Feb 2015 Link to this post

    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.

     
  5. Johannes
    Johannes avatar
    66 posts
    Member since:
    Dec 2012

    Posted 06 Feb 2015 in reply to Kalin Link to this post

    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.
Back to Top