4 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 02 Jan 2014, 05:58 AM
Hi Mike,
Please try the following code snippet to limit the choice for the skins.
ASPX:
C#:
Thanks,
Princy
Please try the following code snippet to limit the choice for the skins.
ASPX:
<
telerik:RadSkinManager
ID
=
"RadSkinManager1"
runat
=
"server"
ShowChooser
=
"True"
OnPreRender
=
"RadSkinManager1_PreRender"
OnSkinChanged
=
"RadSkinManager1_SkinChanged"
>
</
telerik:RadSkinManager
>
C#:
static
string
skin =
"Default"
;
protected
void
RadSkinManager1_PreRender(
object
sender, EventArgs e)
{
RadSkinManager1.Skin = skin;
RadComboBox skinChooser = RadSkinManager1.FindControl(
"SkinChooser"
)
as
RadComboBox;
foreach
(RadComboBoxItem item
in
skinChooser.Items)
{
if
((item.Text ==
"MetroTouch"
) || (item.Text ==
"Default"
))
{
item.Visible =
true
;
}
else
{
item.Visible =
false
;
}
}
}
protected
void
RadSkinManager1_SkinChanged(
object
sender, SkinChangedEventArgs e)
{
RadSkinManager1.Skin = e.Skin;
skin = e.Skin;
}
Thanks,
Princy
0

Mike
Top achievements
Rank 1
answered on 02 Jan 2014, 11:52 AM
Hi Princy,
Thanks for the quick reply.
Can I see the code in vb?
I tried the converter but it failed.
Thanks!
Next time I will remember to state the code version in the initial request.
Thanks for the quick reply.
Can I see the code in vb?
I tried the converter but it failed.
Thanks!
Next time I will remember to state the code version in the initial request.
0

Princy
Top achievements
Rank 2
answered on 02 Jan 2014, 12:20 PM
Hi Mike,
Here is the code in VB
VB:
Thanks,
Princy
Here is the code in VB
VB:
Shared
skin
As
String
=
"Default"
Protected
Sub
RadSkinManager1_PreRender(sender
As
Object
, e
As
EventArgs)
RadSkinManager1.Skin = skin
Dim
skinChooser
As
RadComboBox = TryCast(RadSkinManager1.FindControl(
"SkinChooser"
), RadComboBox)
For
Each
item
As
RadComboBoxItem
In
skinChooser.Items
If
(item.Text =
"MetroTouch"
)
OrElse
(item.Text =
"Default"
)
Then
item.Visible =
True
Else
item.Visible =
False
End
If
Next
End
Sub
Protected
Sub
RadSkinManager1_SkinChanged(sender
As
Object
, e
As
SkinChangedEventArgs)
RadSkinManager1.Skin = e.Skin
skin = e.Skin
End
Sub
Thanks,
Princy
0

Mike
Top achievements
Rank 1
answered on 03 Jan 2014, 09:08 AM
thanks princy. worked well !
note: to any newbie looking at this post, in the examples the character spacing is off, maybe removed by the text editor...
for example "ForEach" should be "For Each" etc.
note: to any newbie looking at this post, in the examples the character spacing is off, maybe removed by the text editor...
for example "ForEach" should be "For Each" etc.