Subclass of tilegroupelement and radtileelement

3 posts, 1 answers
  1. Paul
    Paul avatar
    25 posts
    Member since:
    Jul 2010

    Posted 04 Jul 2012 Link to this post

    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. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 06 Jul 2012 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Paul
    Paul avatar
    25 posts
    Member since:
    Jul 2010

    Posted 06 Jul 2012 Link to this post

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