The RadGrid's skin is not loaded in RadDock

6 posts, 0 answers
  1. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 27 Dec 2007 Link to this post

    Hi,
    I find that if I wrap a RadGrid with skin: outlook in a .ascx, and then use RadDock to load it as you do in the on-line portal example. The skin files (.css images) of RadGrid  will not be properly loaded as in 
    http://www.sendspace.com/file/3qudd3

    After refresh the page, it become normal
    http://www.sendspace.com/file/ii3or6.

    Is this a bug?

    Ricky.
  2. Petya
    Admin
    Petya avatar
    869 posts

    Posted 02 Jan 2008 Link to this post

    Hello Ricky,

    To get the desired scenario working you need to do the following:
    • set RadGrid's EnableEmbeddedSkins to false
    • specify the desired skin with the Skin property
    • make sure you have copied the Skins folder from the installation folder(or "C:\Program Files\Telerik\RadControls 'Prometheus' for ASPNET\Skins") to the root of your application
    • you need to manually register the skins that RadGrid needs, for example in the head of your page for Web20 skin you can add the following:
    <link href="../Skins/Web20/Grid.Web20.css" rel="stylesheet" type="text/css" />

    Let us know if you have any other questions.

    Sincerely yours,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 11 Jan 2008 Link to this post

    Hi, 
    i am based on DNN, so I cannot directly add the <link href...> to the .aspx unless I modify the original codes of DNN, which is not desireable fashion.

    What control or syntax can I employ to dynamically add this markup?

    Thanks a lot.
    Ricky.
  5. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 13 Jan 2008 Link to this post

    Hi,
    I can not get the desired effect, following your instrcutions. Since I develop apps based on DNN, I cannot add <link href="../Skins/Web20/Grid.Web20.css" rel="stylesheet" type="text/css" />  into .aspx, which is dynamically created.

    Hence, I implement a function to simulate the condition, whose code snippet is the following:
    1. Implement dynamically inserting CSS link in a class within App_Code:
                PlaceHolder cssHolder = (PlaceHolder)page.FindControl("CSS");

                if (cssHolder.FindControl(id) == null) // This .css has not been added
                {
                    HtmlGenericControl objLink = new HtmlGenericControl("LINK");
                    objLink.ID = id;
                    objLink.Attributes["rel"] = "stylesheet";
                    objLink.Attributes["type"] = "text/css";
                    objLink.Attributes["href"] = HttpContext.Current.Server.MapPath(filePath);
                   
                    cssHolder.Controls.Add(objLink);
                }


    2. Invoke the preceding function at Page_Init of .ascx where the RadGird resident:
        protected void Page_Init(object sender, EventArgs e)
        {
            // Install external css
            ITCAC.iWork.Framework.Telerik.InstallExternalCSS("~/Skins/Web20/Grid.Web20.css", this.Page);


    Although the skin file within the .ascx, called GridModule, is loaded successfully as the .ascx is a standalone DNN module, it is still not loaded by GridModule that is loaded by the RadDock at first time the RadDock  is added into the module, called DockModule,containing RadDocks.  Again, if I click refresh the page, the skin is loaded properly.

    Ricky.

  6. Ricky
    Ricky avatar
    247 posts
    Member since:
    Jun 2007

    Posted 13 Jan 2008 Link to this post

    Hi Petya,
    Now, I understand the reason about adding <link href...> into the <head> tag you mentioned; when RadDock is added it will merely re-render the UpdatePanel so the .css files (at <heads>) will not be loaded.
    But this is not a appreciate solution since the core dnn codes must be modified.

    Could you direct me another one?

    Thanks,
    Ricky.
  7. Petya
    Admin
    Petya avatar
    869 posts

    Posted 14 Jan 2008 Link to this post

    Hi Ricky,

    We understand the problem you experience. Our suggestion is to dynamically load the CSS files on first load of the module where the docks are/will be, not in the GridModule as it is loaded on AJAX callback when a dock is added.

    Kind regards,
    Petya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017