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

Styling Components

1 Answer 54 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Serif
Top achievements
Rank 1
Serif asked on 29 Jul 2011, 07:54 AM
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

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 03 Aug 2011, 03:45 PM
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 >>

Tags
Expander
Asked by
Serif
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or