This is a migrated thread and some comments may be shown as answers.

[Solved] Problem in applying css

4 Answers 628 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
devika godse
Top achievements
Rank 1
devika godse asked on 05 May 2010, 09:57 AM
I am using Grid(Telerik extension for MVC) on my view page. I have included all the required css files in the content folder and added following code in the Site.Master file :-

<head runat="server">
    <%= Html.Telerik().StyleSheetRegistrar()
                      .DefaultGroup(group => group
                          .Add("telerik.examples.css")
                          .Add("telerik.common.css")
                          .Add("telerik." + Html.GetCurrentTheme() + ".css")
                          .Combined(true)
                          .Compress(true))
                     %>
    <asp:ContentPlaceHolder runat="server" ID="HeadContent" />
    <asp:ContentPlaceHolder id="Head" runat="server">
    </asp:ContentPlaceHolder>
    <% Html.RenderPartial("Header"); %>
</head>

The issues are:-

1) GetCurrentTheme() method is not available.
2)Though telerik.examples.css and telerik.common.css files are present in content folder it throws file not found exception.


Secondly, In the Grouping demo (http://demos.telerik.com/aspnet-mvc-beta/grid/grouping), In the grid code css class is not mentioned and the grid has a look whereas the same code i have added in my view page(Only columns are modified) still the Grid is plain ,no allignment, columns ,no expand-collapse functionality.. nothing..

Is it because the code in Site.Master is not working?

and also for this code in Site.Master-

<% Html.Telerik().ScriptRegistrar()
                     .DefaultGroup(group => group
                         .Add("telerik.examples.js")
                         
                         .Compress(true))
                     .OnDocumentReady(() => { %>prettyPrint();<% })
                     .Render(); %>
    <% Html.RenderPartial("GoogleAnalytics"); %>

Though the file-telerik.examples.js is added in Scripts folder, it throws file not found exception.


4 Answers, 1 is accepted

Sort by
0
Delton Phillips
Top achievements
Rank 1
answered on 20 Aug 2010, 03:42 PM
Did you ever get a reply on this?
0
Delton Phillips
Top achievements
Rank 1
answered on 20 Aug 2010, 04:14 PM
Did you ever get a response on this? I'm gettting the same exact problem.
0
Philip
Top achievements
Rank 1
answered on 29 Aug 2010, 04:21 PM
public static class HtmlExtensions
    {
        public static string GetCurrentTheme(this HtmlHelper instance)
        {
            return instance.ViewContext.HttpContext.Request.QueryString["theme"] ?? "vista";
        }
    }

The GetCurrentTheme() method is not part of the Base MVC release. However you can find it in the Telerik Examples Extension Folder in the HtmlHelpersExtensions.cs file (see above). 

Unfortunately, I have not be able to incorporate the Theme switching capability in the Telerik Examples in my own application.  It would be great if Telerik  would post a simple VS Solution showing how to add Theme switching to user applications!

Regards,
Philip Quarles

0
Drew
Top achievements
Rank 1
answered on 22 Sep 2010, 09:10 PM
I had this issue for a while now, my grid version is "2010.1.309.235".

My fix came when I just launched my site in dev (today) from vs2010, luckily my browser was a little slow on startup and I quickly saw a reference to 'loading.gif' in IE's status bar,

In my telerik css file everything looked correct, but the file not found error would fire everytime I applied a filter to the grid,  BUT not on pageload,.   (the loading.gif graphic doesnt show on load, HINT) 

Purely by a lucky guess I tossed that file "loading.gif" in the root of the site and it worked!

Im not sure it's the same fix for you,..  If it is, let me know.

Im using areas in my project and I think that may have had something to do with it,   I have another mvc project that doesnt have areas and im not getting the problem there.

Good luck!
Tags
Grid
Asked by
devika godse
Top achievements
Rank 1
Answers by
Delton Phillips
Top achievements
Rank 1
Philip
Top achievements
Rank 1
Drew
Top achievements
Rank 1
Share this question
or