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

RadControl in Web Part

3 Answers 174 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 03 Dec 2007, 04:28 PM
all the documentation i've read on radcontrols is their integration into a site (aspx pages etc.).  is it possible to utilize radcontrols within a web part?  reference a specific radcontrol (e.g. radCalendar) to add to the web part?

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 03 Dec 2007, 04:41 PM
Hello Scott,

There are lots of clients which 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();  
 
           RadCalendar calendar = new RadCalendar();  
           calendar.ID = "myCalendar";  
           calendar.RadControlsDir = "~/_layouts/RadControls";  
           /* populate your grid based on your requirements */ 
           Controls.Add(calendar);  
     }  
 
     protected override void RenderWebPart(HtmlTextWriter output)  
     {  
           EnsureChildControls();  
           RenderChildren(output);  
     }  
}   
 
   
 

Kind regards,
Stephen
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
0
Scott
Top achievements
Rank 1
answered on 03 Dec 2007, 05:09 PM
that worked, smooth as a champ.

thanks.
0
Jim
Top achievements
Rank 1
answered on 20 Nov 2008, 06:08 PM
Hi,

I'm trying to create a WebPart using the RadControl in Visual Studio.2008. I have the Telerik controls installed and have a WebPart started. When I try to add RadCalendar calendar = new RadCalendar(); to CreateChildControls(); as described in this post IntelliSense does not recognize it.

Do I need to add a using and if so can you tell me which one? Or do I need to do something else.

Thanks,

Jim
Tags
Sharepoint Integration
Asked by
Scott
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Scott
Top achievements
Rank 1
Jim
Top achievements
Rank 1
Share this question
or