Styling Components

2 posts, 0 answers
  1. Serif
    Serif avatar
    3 posts
    Member since:
    Apr 2011

    Posted 29 Jul 2011 Link to this post

    Hi, 

    Some of the telerik silverlight  components which contains content feature such as radexpander works strange if I try to apply a new style.

    The scenario is that, I try to add a new button in a radexpander header template. In order to activate this button and new style I need to call InitializeComponent method in constructor. However, if I do this, I can listen button events that I added, and there is no compile time
    error. Then at run time my button seems null. I guess there are two instances of the button. 

    There may be a constructor problem, which type of the following should be used in this case;

    public partial class  MyComponent : SomeRadComponent
    {
          public MyComponent() : base()
          {
              //does not show new style
          }
    }
     
    OR
     
    public partial class  MyComponent : SomeRadComponent
    {
          public MyComponent() : base()
          {
                InitializeComponent();
                //cannot  read component at run time
          }
    }
     OR
    public partial class  MyComponent : SomeRadComponent
    {
          public MyComponent()
          {
                InitializeComponent();
                //cannot  read component at run time
          }
    }


    What should I do when I m trying to extend a telerik component without loosing my components ?

    Thanks,
    Serif
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 03 Aug 2011 Link to this post

    Hello Serif,

    Can you please elaborate on your issues? I am afraid that from the code snippets you provided I cannot understand your scenario correctly.

    In the meantime I created a sample project illustrating how to create a custom control deriving from the RadExpander control and how to define a custom style for it. I hope it will get you on the right track.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. DevCraft banner
Back to Top