Theme file path problem

11 posts, 0 answers
  1. David
    David avatar
    14 posts
    Member since:
    Jul 2008

    Posted 15 Jul 2008 Link to this post

    Hi...

    I've added a radtheme manager to my form loading themes from a file, but when i redistrubute my application, the path gets "hardcoded" to the project with my original folder path. Is there a way to reference to a project file or folder?

    thanks
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 16 Jul 2008 Link to this post

    Hi David,

    Thank for interest in RadContols.

    Please, set the ThemeLocation property according to the following pattern:
    "~..\..\ThemeFileName.Extention", assuming that the theme file is in the project directory. The ~ sign mean the root project folder.
    For more information how to add custom themes to your application please read the following KB Article

    Hope this helps.


    Greetings,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. David
    David avatar
    14 posts
    Member since:
    Jul 2008

    Posted 16 Jul 2008 Link to this post

    Thanks a lot!!, it worked great with the embebbed resource.
  5. Shweta
    Shweta avatar
    7 posts
    Member since:
    Jun 2008

    Posted 23 Jul 2008 Link to this post

    hi ,

    ... if we need to set path according to our folder structure then what is the use of adding theme to the project resource (i.e. setting the storage type of radThemeManager as Resource)  ... and when i did this I dint get that theme with my other themes list ....

    Regards,
    Shweta
  6. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 23 Jul 2008 Link to this post

    Hi Shweta,

    Thank you for writing.

    To avoid the theme loading issues, I suggest using the XML theme files as Embedded Resource. To do this, please follow the steps below:
    1. Set the Build Action property to "Embedded Resource" for each of the theme files (you can see this property in the property grid for the corresponding file). 
    2. In the theme manager, change the StorageType property of ThemeSource to "Resource"
    3. In the theme manager, change the ThemeLocation to theme file name including namespace (for example: "MyNamespace.MyCustomTheme.xml").
    I hope this helps, If you have other questions, do not hesitate to contact me again.

    Best wishes,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Henryk
    Henryk avatar
    4 posts
    Member since:
    Feb 2013

    Posted 28 Nov 2014 in reply to Martin Vasilev Link to this post

    Hi,
    I load themes as files and its work fine.
    Then i change to your version ( load themes as resources) and it works only in design window in visual studio, but when i start application it does not.
    When i change it to load themes as file as the first time, it works as he variant with resources. How resolve this problem?
  8. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 03 Dec 2014 Link to this post

    Hello Henryk,

    Thank you for writing.

    Please refer to our Adding a custom theme as a resource help article which is quite useful on this topic. Additionally, I have prepared a sample video (drag and drop over the browser to play) demonstrating the steps. You can find it in the attachment.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    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.

     
  9. Henryk
    Henryk avatar
    4 posts
    Member since:
    Feb 2013

    Posted 03 Dec 2014 in reply to Dess Link to this post

    Thank you for reply.
    Idid every thing like in video, and i can choose this theme for my buton, and i can see styled buton but only in design view in visual studio. When i run application i can see this styled buton:( Why?
  10. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 08 Dec 2014 Link to this post

    Hello Henryk,

    Thank you for writing back.

    If the RadButton.ThemeName is not reset at run-time, you are supposed to obtain a styled button, following the demonstrated steps from my sample video. Could you please provide a video demonstrating the steps that you perform together with the result that you obtain? Additionally, could you please specify the exact version that you are currently using? Thank you in advance.

    Another approach is to open a support ticket where you can provide the sample project reproducing the described problem. Thus, we would be able to investigate the precise case and assist you further. 

    I am looking forward to your reply.

    Regards,
    Desislava
    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.

     
  11. Henryk
    Henryk avatar
    4 posts
    Member since:
    Feb 2013

    Posted 08 Dec 2014 in reply to Dess Link to this post

    Hello,
    thank you for reply
    I just solved problem. In 3 step "In the theme manager, change the ThemeLocation to theme file name including namespace (for example: "MyNamespace.MyCustomTheme.xml")". In my case solving was set ThemeLocation to MyNamespace.Resources.MyCustomTheme.xml.
  12. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 10 Dec 2014 Link to this post

    Hello Henryk,

    Thank you for writing back.

    I am glad that the issue you were facing is now resolved. In the referred help article in my post from 03-Dec-2014 it is noted that in a C# application the pattern for the resource location is ProjectDefaultNamespace.ContainingFolderName.ThemeFileName.Extention if the theme file is in a folder, otherwise it is just ProjectName.ThemeFileName.Extention.

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Desislava
    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.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready