loading and saving skin settings to a database

5 posts, 0 answers
  1. Ashley
    Ashley avatar
    22 posts
    Member since:
    Jul 2010

    Posted 05 Aug 2010 Link to this post

    Hi all,

    I am building a dashboard that uses docks and forms and currently have the skin chooser set up so the user can select a theme.
    I want to get the name of that theme name from the skin chooser into a visual c variable and write it to the database. I then I want to load it  into the skin manager when the dashboard starts next time. I am confident with writing to the database. Its getting the values to and from the skin manager into a variable.

    Please reply asap 
    regards,

    Ash
  2. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 10 Aug 2010 Link to this post

    Hi Ashley,

    You can access the value of the currently chosen skin by using the following line:

    string skin = RadSkinManager1.GetSkinChooser().SelectedValue;

    And respectively set it with:

    RadSkinManager1.GetSkinChooser().SelectedValue = "Sitefinity";

    I hope this helps.

    All the best,
    Tsvetina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ashley
    Ashley avatar
    22 posts
    Member since:
    Jul 2010

    Posted 10 Aug 2010 Link to this post

    Hi thanks for helping me so far the getvalue works but im having trouble with the set, the only thing I can think of is that i am trying to change it in a function called on  "onload" when the skinmanager loads

    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" ShowChooser="true"   OnLoad="loadtheme" OnSkinChanged="changetheme">

     

    protected void loadtheme(object sender, EventArgs e)

     

    {

    _conn.Open();

     

    SqlCommand command2 = new SqlCommand("select theme from States where [id]='" + _userID + "' ", _conn);

     

     

    SqlDataReader r = command2.ExecuteReader();

     

     

    while (r.Read())

     

    {

    RadSkinManager1.GetSkinChooser().SelectedValue = r[

    "theme"].ToString();

     

    }

    r.Close();

    _conn.Close();

    }


    select statement returns "Telerik"

    regards,

    Ash
  5. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 13 Aug 2010 Link to this post

    Hi Ashley,

    Could you please confirm if the Skin is not set in all cases or only on the inital Load event of the control? It is not set the first time the control loads, when using that approach, but after a postback it is set as expected. Is this the same behavior which you observe?

    Greetings,
    Tsvetina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Ashley
    Ashley avatar
    22 posts
    Member since:
    Jul 2010

    Posted 13 Aug 2010 Link to this post

    Hi Tsvetina,

    I have solved my problem, 1. by setting the value b4 the page loads and 2. setting RadSkinManager.Skin instead.
    Thank you for help it was appreciated.

    regards,

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