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

changing skin dynamicly

2 Answers 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
emrah
Top achievements
Rank 1
emrah asked on 04 Mar 2009, 02:28 PM
Can you guide me for the possible ways of accessing all telerik controls from a different class  using Control Collection.?

i am trying to change all controls skin by this way .
 
Regards,

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 04 Mar 2009, 03:17 PM
Hi emrah,

It is easier to use RadSkiinManager for changing a skin for a lot of control:

http://www.telerik.com/help/aspnet-ajax/radskinmanager.html

Otherwise, you can for example iterate through all controls on the page and check whether a control's type is RadControl, RadWebControl or RadDataBoundControl. All these types have a Skin property.

Regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
emrah
Top achievements
Rank 1
answered on 05 Mar 2009, 08:06 AM

thnaks for your  reply. i solved my issues just like this function :


 

 

public void setSkinThemeAllControls(System.Web.UI.ControlCollection CC, String themeName)

 

{

 

foreach (Control child in CC)

 

{

setSkinThemeAllControls(child.Controls, themeName);

 

switch (child.GetType().ToString())

 

{

 

case "Telerik.Web.UI.RadCalendar":

 

Telerik.Web.UI.

RadCalendar control1 = (Telerik.Web.UI.RadCalendar)child;

 

control1.Skin = themeName;

 

break;

 

 

case "Telerik.Web.UI.RadChart":

 

Telerik.Web.UI.

RadChart control2 = (Telerik.Web.UI.RadChart)child;

 

control2.Skin = themeName;

 

break;
.
.
.
.
.
.

}


and i called this function from a page just like :


 

CsSkin.setSkinThemeAllControls(

this.Controls, "Vista")

 

Tags
General Discussions
Asked by
emrah
Top achievements
Rank 1
Answers by
Dimo
Telerik team
emrah
Top achievements
Rank 1
Share this question
or