RadSkinManager Targetcontrols code behind issue

2 posts, 1 answers
  1. Jacques
    Jacques avatar
    8 posts
    Member since:
    Mar 2013

    Posted 20 Feb 2015 Link to this post

    Hi there,

    I hope somebody can help me with this one.

    I want to change the skin of a particular type of controls by setting the TargetControls collection of the RadSkinManager in code behind.
    I use the following code:

    protected void cbSkins_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs )
            {     
          RadSkinManager1.TargetControls.Clear();
          string skinName = e.Text;
    RadSkinManager1.TargetControls.Add(Telerik.Web.UI.ControlTypeToApplySkin.RadButton, skinName);
            }

    The first time the event is hit the skin of the RadButton is changed on the page, which is OK.
    After the second time the event is hit the skin of the RadButton is not changed.

    Does anybody know why the skin is only changed the first time the event is hit?

    Regards,

    Marcel
  2. Answer
    Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 25 Feb 2015 Link to this post

    Hi Jacques,

    It is too late to use the SelectedIndexChange event to modify the skin in the page lifecyle. Therefore the required functionality should be achieved by using Skin Chooser of the Skin Manager for this purpose.

    Regards,
    Maria Ilieva
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top