Dec 18, 2008

Telerik RadSkinManager doesn't persist the Skin.


If you programatically change the Telerik RadSkinManager Skin property it won't get persisted in the key you added.
This is because probably in telerik asumed if there is no skin chooser the skins won't change and will be loaded from the markup. It is not a bad decision.
However, you may find yourself in need to programatically change the skin and want it persisted.
To do the things tidy I did a small code to persist the skin where it should be persisted.
Here is the code:
        
switch (rsMgr.PersistenceMode)
        {
          
case RadSkinManagerPersistenceMode.Cookie:
            
// Create a cookie to persist the skin selection for the session only:
             HttpCookie cookieSkin = new HttpCookie(rsMgr.PersistenceKey, rsMgr.Skin);
             Response.Cookies.Add(cookieSkin);
            
break;
          
case RadSkinManagerPersistenceMode.Session:
            
// Create a session variable with the same name:
             Session[rsMgr.PersistenceKey] = rsMgr.Skin;
            
break;
          
case RadSkinManagerPersistenceMode.ViewState:
            
// View state variable:
             ViewState[rsMgr.PersistenceKey] = rsMgr.Skin;
            
break;
        }

where rsMgr is RadSkinManager.
Now you may paste this code in a method and call this method after you programatically assign skin to the manager. I needed this because I wanted to allow the user to change from some of the skins (not all of them) I couldn't find a way to only hide few skins and display others so I can use the standard functionality of the SkinChooser proerty so I added my own RadCombobox with the skins I want displayed.

Hope this helps someone out there...

Dec 14, 2008

Nice little tool to help me with twitter.

I created a small twitter software what it does is to check each hour if I am listening to Winamp, get the song if possible and write it in twitter for me and the people who are eventually interested in what I am listening.
Here is the deal:



You can download it from here:
TWamp - Nice little twitter software

You can follow me on twitter from the following url:
My twitter profile

Please note: TWamp isn't very user friendly. You need to get along with it in order to use it ;).