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

RadGrid In SharePoint site

1 Answer 235 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
No
Top achievements
Rank 1
No asked on 15 Nov 2007, 02:39 AM
Hi,
I use default masterpage of SharePoint Site evething seem ok but 
 when i change master page of SharePoint site, it have an Error:
"The "TelerikRadGrid" Web Part appears to be causing a problem. Exception has been thrown by the target of an invocation."
I use RadRid version 4.6.2.0 and MSOO 2007.
Can you help me fix this bug?
Thanks a lot.

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 16 Nov 2007, 02:46 PM
Hi No,

There are lots of clients who have implemented web parts based on RadControls.

Usually, the most difficult thing is to set the RadControlsDir property to valid location because it is a bit tricky in SharePoint environment. Most of the time we suggest copying the /RadControls folder in C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS and then referring to it as "~/_layouts/RadControls".
Another option is to copy that folder in the root folder of your site and then exclude it from the SharePoint managed paths using stsadm.exe.

Creating a webpart based should be quite simple - here is a short sample:

public class MyWebPart : WebPart
{
     protected override void CreateChildControls()
     {
           base.CreateChildControls();

           RadGrid grid = new RadGrid();
           grid.ID = "myGrid";
           grid.RadControlsDir = "~/_layouts/RadControls";
           /* populate your grid based on your requirements */
           Controls.Add(grid);
     }

     protected override void RenderWebPart(HtmlTextWriter output)
     {
           EnsureChildControls();
           RenderChildren(output);
     }
}

All features of our grid control should be available under SharePoint environment as well.

Also verify that you are using the latest grid version (5.0.1) and check whether you are using a custom Master Page and the asp:ContentPlaceHolder that contains the WebPartZone resides outside the <form> tag of the page. RadGrid needs to be inside a Form with runat=server to work properly.

If so, please modify your Master Page or change the PlaceHolder / WebPartZone so that RadGrid is inside the <form> tag. This should solve your problem.

Best regards,
Stephen
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
Tags
Sharepoint Integration
Asked by
No
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or