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

Iterating over all of the controls within a RadMultiPage?

1 Answer 62 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Chris Chubb
Top achievements
Rank 1
Chris Chubb asked on 25 Sep 2009, 08:28 PM
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. 

1 Answer, 1 is accepted

Sort by
0
Vesko
Top achievements
Rank 2
answered on 26 Sep 2009, 11:22 AM
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.
Tags
TabStrip
Asked by
Chris Chubb
Top achievements
Rank 1
Answers by
Vesko
Top achievements
Rank 2
Share this question
or