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

RadGrid in SharePoint

7 Answers 297 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Abrash
Top achievements
Rank 1
Abrash asked on 13 Oct 2010, 03:07 PM

I am using telerik RadGrid inside a user control. When I use the user control inside a normal ASP.NET page, I am able to see the full functionality of the telerik radGrid such as colors, header column click and so on.

 

When I move the code to a web part and deploy on the SharePoint site, I lose all the functionality and formatting. It appears to me that it is not reading any CSS or JavaScript at all.

I have deployed Telerik.Web.UI dll to the GAC. It's version #  2009.3.1103.20
What am I doing wrong?

 

Please help!

Entry at the top of my control.acsx file.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyControl1.ascx.cs" Inherits="_controls_MyControl" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

   

<telerik:RadGrid ID="uiSignInGrid" runat="server" AutoGenerateColumns="False" GridLines="None">


 

In my master page for the SharePoint site, I have added links to all desired files.

<link href="/_layouts/global/css/global.css" rel="stylesheet" type="text/css" />

<link href="/_layouts/global/radcontrols/Dock/Dock.MyApp.css" rel="stylesheet" type="text/css" />

<link href="/_layouts/global/radcontrols/Grid/Grid.MyApp.css" rel="stylesheet" type="text/css" />

<link href="/_layouts/global/radcontrols/TabStrip/TabStrip.MyApp.css" rel="stylesheet" type="text/css" />

<link href="/_layouts/global/radcontrols/TabStrip/TabStrip.ViewEdit.css" rel="stylesheet" type="text/css" />

<link href="/_layouts/global/radcontrols/ToolTip/ToolTip.MyApp.css" rel="stylesheet" type="text/css" />

<link href="/_layouts/global/radcontrols/ToolTip/ToolTip.MyApp_RollOver.css" rel="stylesheet" type="text/css" />

 

My web.config for the SharePoint site, contains following entries in their respective places.


Added following entries to <configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  
  
  
Added following entry to <SafeControls>
<SafeControl Assembly="Telerik.Web.UI, Version=2009.3.1103.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TypeName="*" Safe="True" />
  
  
Following entry from httphandler
  
  <httpHandlers>
      <remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
      <remove verb="GET,HEAD,POST" path="*" />
      <add verb="GET,HEAD,POST" path="*" type="Microsoft.SharePoint.ApplicationRuntime.SPHttpHandler, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <add verb="OPTIONS,PROPFIND,PUT,LOCK,UNLOCK,MOVE,COPY,GETLIB,PROPPATCH,MKCOL,DELETE,(GETSOURCE),(HEADSOURCE),(POSTSOURCE)" path="*" type="Microsoft.SharePoint.ApplicationRuntime.SPHttpHandler, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2009.3.1103.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"   validate="false"/>
  
        
    </httpHandlers>
  
Added an entry in the httpModules
  
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  
Following is the handler entry
  
<handlers>
      <remove name="WebServiceHandlerFactory-Integrated" />
      <remove name="ScriptHandlerFactory" />
      <remove name="ScriptHandlerFactoryAppServices" />
      <remove name="ScriptResource" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  
Added a system.webserver section.
  
<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <remove name="ScriptModule" />
      <add name="ScriptModule" preCondition="managedHandler"
         type="System.Web.Handlers.ScriptModule,
           System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
           PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory" />
      <remove name="ScriptHandlerFactoryAppServices" />
      <remove name="ScriptResource" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx"
         preCondition="integratedMode"
         type="System.Web.Script.Services.ScriptHandlerFactory,
           System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
           PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*"
         path="*_AppService.axd"
         preCondition="integratedMode"
         type="System.Web.Script.Services.ScriptHandlerFactory,
           System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
           PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" preCondition="integratedMode"
         verb="GET,HEAD" path="ScriptResource.axd"
         type="System.Web.Handlers.ScriptResourceHandler,
           System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
           PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  </system.webServer>

 

7 Answers, 1 is accepted

Sort by
0
Abrash
Top achievements
Rank 1
answered on 13 Oct 2010, 03:19 PM
In another place, I saw the following comment from a Telerik Team. I have done everything as per this article but still I am unable to view the desire functionality of Radgrid within SharePoint.

I promise to write a good user friendly blog article with examples if I can get some decent help on this issue.

Thanks,

*****************************************************************************************************************888888
Hi,

Take a look at the following help article, which explains how to deploy RadControls for ASP.NET AJAX in a MOSS 2007/ WSS 3.0 site - http://www.telerik.com/help/aspnet-ajax/moss-deploying-radcontrols.html

The error you see is because you have not copied the Telerik.Web.UI assembly to the web server's GAC.

All the best,
Lini
the Telerik team
0
Tsvetoslav
Telerik team
answered on 18 Oct 2010, 08:45 AM
Hi Abrash,

Could you explain in more detail what you are trying to achieve with the custom css files. Is this a custom skin for some of the controls? If so, I'd suggest that you go through the following help articles for more information on creating custom skins:
http://www.telerik.com/help/aspnet-ajax/menu_appearancecreatingacustomskin.html
http://www.telerik.com/help/aspnet-ajax/menu_appearancecssfile.html

More information on your scenario will be much appreciated.

I'd also suggest you that you inspect the server requests that are made by your web-part page with Fiddler or FireBug. Please, check to see if the browser is issueing a GET Request for your external style sheets.

If the problem persists, could you also try upgrading to the latest version of the controls suite and see if it makes any difference.

Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Abrash
Top achievements
Rank 1
answered on 18 Oct 2010, 03:31 PM

Hi Tsvetoslav,
My problem is not with the telerik controls with ASP.NET application.  Everything works without any issue. The problems arise when I move the same code to a SharePoint webpart.


http://www.telerik.com/community/forums/sharepoint-2007/controls/how-to-use-radgrid-control-in-moss.aspx

 

Based on the advice from Sebastian, I have tried to make it work. It looks like a configuration issue with SharePoint.  I have even uploaded screen-shots that you can review.

 

I think it is a very simple issue. Could you provide me with steps by steps instructions on things that need to be done to make telerik controls ( radgrid specially) under SharePoint 2007.

PLEASE do not suggest me to upgrade. That is not an option. I am just a poor contracter asked to do a job. Client would not upgrade to the latest version until  Telerik can officially say that they do not support Radgrid within SharePoint 2007.

Thanks,
Abrash

0
Abrash
Top achievements
Rank 1
answered on 18 Oct 2010, 03:37 PM
Hi,
I would appreciate examples or snippets related to telerik radgrid within SharePoint 2007 as opposed to radmenu or other controls.

RadGrid examples within SharePoint 2007 would speed up my development.

Thanks!
0
Tsvetoslav
Telerik team
answered on 20 Oct 2010, 06:23 PM
Hi Abrash,

Excuse me for not being able to provide a sample code since we are extremely busy with the upcoming release scheduled at the end of the week. However, incorporating RadGrid into SharePoint 2007 is quite easy. Please, go through the following tutorial on how to create a RadControls web part in SharePoint 2007:
http://www.telerik.com/help/aspnet-ajax/create-ajax-enabled-sharepoint-webpart-radcontrols.html

Instead of the RadTreeView you will have a RadGrid created in the OnLoad event with a NeedDataSource event handler attached to it programmatically. The in the NeedDataSource event handler you should provide the data for the grid and assign it to its DataSource property.

If instead you prefer binding the grid to a DataSource control, just add the DataSource control to the WebPart Controls collection and assign its ID to the DataSourceID property of the grid.

Hope this informaton helps.


Best wishes,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Abrash
Top achievements
Rank 1
answered on 26 Oct 2010, 03:41 PM

I still do not have any supportive answer for my issues. I am not sure why simple mundane things are taking time. I was expecting that Gurus at Telerik should be able to provide me the answer.

I had two major issues:

  1. Styles and skins not showing up properly
  2. Sorting behavior not working properly.

 

I did following things in order to make it working.

 

  1. For my first issues, I found the fix. I still do not have any definitive solution from their end.

I was using the skin file in App_theme folder of my ASP.NET application.

 

<telerik:RadGrid runat="server" EnableEmbeddedBaseStylesheet="True" EnableEmbeddedSkins="false" ImagesPath="~/global/radcontrols/Grid/MyLink" Skin="BrokerLink">

</telerik:RadGrid>

 

I took the code from the skin file and put in the individual grid of my ACSX page which goes into the SharePoint.

 

<telerik:RadGrid ID="uiUserGrid" runat="server" AutoGenerateColumns="False" GridLines="None" 

                AllowPaging="True" AllowSorting="true" PageSize="20" EnableEmbeddedBaseStylesheet="True" EnableEmbeddedSkins="false" ImagesPath="~/_layouts/global/radcontrols/Grid/MyLink" Skin="MyLink">

 

I know this is not the best approach since I have to do it for all RadGrids in my application. However, this is what I came up as a fix.

 

I am still looking for telerik help.

 

 

  1. For my second issues, I found that the issue was with the <ASP:UpdatePanel> tag in the following code. If I take it out, sorting begins to work.

 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

        <ContentTemplate>

           <telerik:RadGrid ID="uiUserGrid" runat="server" AutoGenerateColumns="False" GridLines="None"

                AllowPaging="True" AllowSorting="true" PageSize="20">

 

 

I am not sure why UpdatePanel does not work inside a user control embedded within a SharePoint web part.

 

 

In one place, I noticed people talking about using Telerik RadAjaxManager. I used the following block of code. However, it still did not work.

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >

            <AjaxSettings>

                <telerik:AjaxSetting AjaxControlID="uiUserGrid" >

                    <UpdatedControls>

                        <telerik:AjaxUpdatedControl ControlID="uiUserGrid"   />

                     </UpdatedControls>

                 </telerik:AjaxSetting>

             </AjaxSettings>

    </telerik:RadAjaxManager>  

   

 

 

At this time, I am desparately looking for Telerik to help me resolve UpdatePanel issues related to a RadGrid.

 

PLEASE HELP!!!

0
Tsvetoslav
Telerik team
answered on 28 Oct 2010, 05:54 PM
Hi Abrash,

The following steps should provide a solution to the ajax issue. Here they are:

1. Add a RadAjaxManager to your web part programmatically as follows:
RadAjaxManager ajaxmgr;
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    ajaxmgr = new RadAjaxManager();
    Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
}

2. Ajaxify the grid in the user control as shown below (again in the code behind of the web part):

protected override void CreateChildControls()
{
    Control control = Page.LoadControl("Virtual path to your ascx control");
    Controls.Add(control);
    RadGrid grid = control.FindControl("RadGrid1") as RadGrid;
    ajaxmgr.AjaxSettings.AddAjaxSetting(grid, grid);
}


Best wishes,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Sharepoint Integration
Asked by
Abrash
Top achievements
Rank 1
Answers by
Abrash
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or