RadGrid In SharePoint site

2 posts, 0 answers
  1. No
    No avatar
    1 posts
    Member since:
    Nov 2007

    Posted 14 Nov 2007 Link to this post

    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.
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 16 Nov 2007 Link to this post

    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

Back to Top