Iterating over all of the controls within a RadMultiPage?

2 posts, 0 answers
  1. Chris Chubb
    Chris Chubb avatar
    7 posts
    Member since:
    Nov 2005

    Posted 25 Sep 2009 Link to this post

    I am executing some code that looks like this:

            Private Sub SetAllTelerikControlsSkin(ByVal Container As Control, ByVal Skin As String
                For Each ctl In Container.Controls 
                    If Not (ctl.GetType().GetProperty("Skin"Is NothingThen 
                        ctl.EnableEmbeddedSkins = False 
                        ctl.Skin = Skin 
     
                    End If 
                    'Keep digging. If I have children, set them. 
                    If Not (ctl.GetType().GetProperty("HasChildren"Is NothingAndAlso ctl.HasChildren Then 
                        'Is a container control; call myself 
                        SetAllTelerikControlsSkin(ctl, Skin) 
                    End If 
                Next ctl 
     
            End Sub 
     

    Starting out the Container parameter is "Me". 

    The problem is that any container controls, specifically the RadMultiPage's children (it's PageViews) don't get caught up here because it would seem that RadMultiPage doesn't have a property "Skin" and it doesn't have the Property "HasChildren" either. Do I have to do a special property call for MultiPage / PageViews in order to iterate down into them to set skin properties? 

    Any ideas so I don't have to go into the source code and set every RAD control manually by name whenever I add one to the control? I also plan on doing the same for any user controls in my page. 
  2. Vesko
    Vesko avatar
    122 posts
    Member since:
    Mar 2009

    Posted 26 Sep 2009 Link to this post

    As far as I know you can set the Skin property globally in the web.config file. It can be set for a particular control type (e.g. RadTabStrip) or for all RadControls in the project.
    Here is the relevant help topic:
    Skin Registration (check the Global skin setting for the entire web site/web application project paragraph)

    For your information you can take a look at the RadSkinManager control (although I find it useful for the built-in skins mostly)

    Hope this helps.
Back to Top