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

Subclass of tilegroupelement and radtileelement

2 Answers 124 Views
Panorama
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 04 Jul 2012, 09:08 AM
Hi

I have created a subclass of TILEGROUPELEMENT and RADTILEELEMENT but when I create the objects and add them to the Panorama object they don't seem to inherit the standard theme or mouse over attributes. They look flat and static.

I tried overriding the ThemeEffectiveType property but it made no difference.

Any suggestions ?


Thanks in advance.


Paul.

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Todorov
Telerik team
answered on 06 Jul 2012, 12:22 PM
Hello Paul,

Thank you for contacting us.

The ThemeEffectiveType property must be overridden when inheriting from an element in order to keep the styling of the base class. I was not able to observe any issues when using the following two subclasses with RadPanorama:
public Form3()
{
    InitializeComponent();
 
    MyGroup group = new MyGroup() { Text = "Custom Group" };
    this.radPanorama1.Groups.Add(group);
    group.Items.Add(new MyTile() { Text = "Custom Tile" });
 
    TileGroupElement group1 = new TileGroupElement() { Text = "Normal Group" };
    this.radPanorama1.Groups.Add(group1);
    group1.Items.Add(new RadTileElement() { Text = "Normal Tile" });
}
 
public class MyTile : RadTileElement
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadTileElement);
        }
    }
}
 
public class MyGroup : TileGroupElement
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(TileGroupElement);
        }
    }
}

Please try using the code above and let me know if you continue to experience issues. Also if you have any additional questions, do not hesitate to ask.

All the best,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Paul
Top achievements
Rank 1
answered on 06 Jul 2012, 01:49 PM
Hi Ivan

Yes sorry. I had worked it out. It was my mistake. I should have posted back to let you know.

I had overrode the ThemeEffectiveType but didn't change the default return type to either "radelementtile" or "tilegroupelement".

Thanks for confirming this for me.

Paul.
Tags
Panorama
Asked by
Paul
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Paul
Top achievements
Rank 1
Share this question
or