Does anyone have a good technique for connecting a RadGrid to a SharePoint list while still keeping all the design time features of the RadGrid? I don't. Here's everything I've tried and what sucks about it. BTW, I'm not blaming Telerik. This is more of a VS <--> SP problem.
Using SP Metal, I've create all the classes to connect to my SharePoint data. Now I'm stuck at connecting this to a RadGrid (or even a built in GridView). You have to have a data source to connect to. Logic says that you should use a LinqDataSource. Unfortunately, that control isn't "native" to the SP visual web part template. You'll have to go into the ascx and add <%@ Register Tagprefix="aspweb" Namespace="System.Web.UI.WebControls" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> so that you can use <aspweb:LinqDataSource />. The RadGrid easily connects to the LinqDataSource, but you can't configure the LinqDataSource to connect DataContext object created with SP Metal. The only thing I can find online is using the Selecting event of the LinqDataSource to populate the data, or not using the LinqDataSource and populate the RadGrid's DataSource in the page Load event, or the RadGrid's NeedDataSource event. All of those options destroy the chance to use the nice design-time editor Telerik has designed for the RadGrid.
I've tried this same thing outside of a SP template and had no problems (aside from an annoying Microsoft.Sharepoint.Sandbox.dll file that keeps getting added to the bin\ folder that you have to delete).
Am I missing something? I doubt I'm the only one trying to display SP list data in a grid and use the editor to do my styling. This is driving me up a wall. I've thought about creating all the user controls outside of a SP template and then trying to load those, or creating my own type of data source to wrap around the Metal classes, but this seems a bit too complicated. Am I doing something wrong, or does anyone have a clean solution to my problem?
Using SP Metal, I've create all the classes to connect to my SharePoint data. Now I'm stuck at connecting this to a RadGrid (or even a built in GridView). You have to have a data source to connect to. Logic says that you should use a LinqDataSource. Unfortunately, that control isn't "native" to the SP visual web part template. You'll have to go into the ascx and add <%@ Register Tagprefix="aspweb" Namespace="System.Web.UI.WebControls" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> so that you can use <aspweb:LinqDataSource />. The RadGrid easily connects to the LinqDataSource, but you can't configure the LinqDataSource to connect DataContext object created with SP Metal. The only thing I can find online is using the Selecting event of the LinqDataSource to populate the data, or not using the LinqDataSource and populate the RadGrid's DataSource in the page Load event, or the RadGrid's NeedDataSource event. All of those options destroy the chance to use the nice design-time editor Telerik has designed for the RadGrid.
I've tried this same thing outside of a SP template and had no problems (aside from an annoying Microsoft.Sharepoint.Sandbox.dll file that keeps getting added to the bin\ folder that you have to delete).
Am I missing something? I doubt I'm the only one trying to display SP list data in a grid and use the editor to do my styling. This is driving me up a wall. I've thought about creating all the user controls outside of a SP template and then trying to load those, or creating my own type of data source to wrap around the Metal classes, but this seems a bit too complicated. Am I doing something wrong, or does anyone have a clean solution to my problem?