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

Datagrid - moss 2007

1 Answer 95 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Tai
Top achievements
Rank 1
Tai asked on 06 Feb 2008, 05:44 PM
Hi,

My collegues have used telerik datagrid controls in ASP.net application and looks very cool.

I am researching on how i can integrate datagrid into MOSS 2007 web parts for my new project. I need to connect to the SQL database through webpart.

I have not found any information (white paper etc) on how i can intergrate and connect to SQL database from the datagrid through MOSS 2007 web parts and how much effort needed? There is some information for deploying to aspx page but not through web part.

Thank you for your help.

Tai

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 07 Feb 2008, 09:05 AM
Hello Tai,

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();  
 
           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);  
     }  
}   
 
 

Furthermore, you can find an integration document for RadControls under SharePoint here:

http://www.telerik.com/products/sharepoint/overview.aspx

Finally, connecting the grid to a database will probably be no different than attaching it to database in a standard ASP.NET web site. Review the Populating the control with data chapter from the online documentation for further details on how to supply source for our web grid and bind it.

Best regards,
Stephen
the Telerik team

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