2

I've been trying to use the SPGridView control, which I've seen in quite a few examples around the web. This control is contained in the Microsoft.SharePoint.WebControls namespace which is in the Microsoft.SharePoint dll. But this dll does not appear in my list of available references in Visual Studio 2013.

I have the Office Developer Tools installed, so is there any other package I need to get this library? I'm developing for SharePoint Online, so I don't have a local SharePoint environment (some other forum posts suggested copying this library off of the SharePoint server). If it's not a library, how would I go about getting hold of this binary?

Any & all help would be greatly appreciated.

  • In visual studio 2013 try : Add reference -> assemblies -> framwork 4.5 dll. Search for sharepoint. I hope you might get there. – Aanchal Jun 5 '14 at 13:51
  • 1
    Unfortunately not. The closest I see is Microsoft.SharePoint.Client, which I already have a reference to. – Carl Heinrich Hancke Jun 5 '14 at 13:57
5

You can only use that DLL in a farm solution, which requires development on a SharePoint server. You will need to use a plain old asp.net GridView for what you are doing.

| improve this answer | |
  • Thank you for the confirmation, this was driving me insane. Just to follow on from this, would it then be possible to style my GridView to look like a SharePoint grid then? Otherwise this grid will be the only one that looks different... – Carl Heinrich Hancke Jun 5 '14 at 14:24
  • Yeah, you'll want to look into a standard SharePoint list view or whatever and inspect its structure and CSS classes, and do the same inside your GridView's template. – Derek Gusoff Jun 5 '14 at 14:40
2

For SharePoint Online you can only use Microsoft.SharePoint.Client

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.