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

The RadGrid's skin is not loaded in RadDock

5 Answers 103 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 1
Ricky asked on 27 Dec 2007, 08:30 AM
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.

5 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 02 Jan 2008, 09:42 AM
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
0
Ricky
Top achievements
Rank 1
answered on 11 Jan 2008, 03:04 PM
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.
0
Ricky
Top achievements
Rank 1
answered on 13 Jan 2008, 11:55 AM

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.

0
Ricky
Top achievements
Rank 1
answered on 13 Jan 2008, 12:09 PM
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.
0
Petya
Telerik team
answered on 14 Jan 2008, 04:13 PM
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
Tags
Dock
Asked by
Ricky
Top achievements
Rank 1
Answers by
Petya
Telerik team
Ricky
Top achievements
Rank 1
Share this question
or