We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

User Changed Themes At Runtime

Thread ID:





126138 Sep 26,2016 07:31 PM UTC Sep 28,2016 04:42 AM UTC ASP.NET MVC 3
Tags: Grid
Nate Greene
Asked On September 26, 2016 07:31 PM UTC

My entire site is set to the bootstrap theme, is it possible to set something up that allows the user to select what theme they want to use while using the site through a dropdown list that contains premade themes made available through the standard set that is offered from Syncfusion for most of its components including the grid.

Thanks for any help at all,


Prasanna Kumar Viswanathan [Syncfusion]
Replied On September 27, 2016 01:58 PM UTC

Hi Greene, 
Thanks for contacting Syncfusion support. 
We created a sample and in this sample we have rendered the dropdown control with data source and dropdown data source value is based on the Grid theme name (eg. flat-saffron, flat-lime, etc.). If we change the theme name, then the corresponding theme will appear in the Grid.  
Refer to the code example and sample,    
Code example:  
   @Html.EJ().DropDownList("DropDownList1").Datasource((IEnumerable<object>)ViewData["LocalDataSource"]).DropDownListFields(Df => Df.Text("Text")).ClientSideEvents(e=>e.Change("change"))  
         .AllowPaging()    /*Paging Enabled*/  
       .Columns(col =>  
          . . .              
<Change Event>  
    function change(args) {  
        var link = window.document.getElementsByTagName('link'); //get the link of css file  
        var value = args.value; // get the dropdown value  
        $(link).attr('rel='nofollow' href'"/Content/ej/web/" + value + "/ej.web.all.min.css") // Change the theme  
Note: The corresponding content folder will be in following structure.   
Prasanna Kumar N.S.V 

Nate Greene
Replied On September 27, 2016 10:23 PM UTC

Works great thanks for the help!

Prasanna Kumar Viswanathan [Syncfusion]
Replied On September 28, 2016 04:42 AM UTC

Hi Greene,
We are happy that the provided solution working fine at your end.
Please let us know if you need any further assistance.
Prasanna Kumar N.S.V 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon