I know this is a basic question! But still, I need to know

  1. What is Grid View?
  2. How to use it?
  3. What is it used for?

Any documentation or links will be of a great use! Thanks!

-saumil Using SP2010

  • 2
    Please elaborate. Do you want to programmatically use the standard ASP.NET GridView or the SharePoint specific SPGridView. – Jeroen Ritmeijer - Muhimbi Jun 22 '11 at 8:11
  • Sorry all for less elaborate. What I meant was "SP Grid View" – neo269 Jun 22 '11 at 11:45

Here are some links about how to implement paging and filtering in SPGridView

| improve this answer | |
  • Excellent Information! Will it work on SP2010 also? – neo269 Jun 22 '11 at 14:08
  • 1
    Will work fine in SP2010 – Jeroen Ritmeijer - Muhimbi Jun 22 '11 at 14:15

GridViews, as linked to by Ziga, are a standard .NET control. If you're asking about that, then you'd probably be better off asking at Stackoverflow; this is the forum about SharePoint technologies.

However, SharePoint does have it's own SPGridView. It's much like the standard .NET one, but doesn't have some of the features of the .NET one (such as auto generated columns)

Both controls take data from an ADO Datasource (such as a DataTable) and display it as tabular data. The SharePoint one also formats and styles it to look 'SharePointy'. They also allow paging, sorting, grouping, etc.. In fact, they're very powerful controls.

Regarding using them - well, lots of examples are already online, but I'll highlight the MSDN one about SPGridView. Most examples that apply to GridViews also apply to SPGridViews. You do have to make a choice between declarative and programmatic syntax - that is, you could define your SPGridView just through ASP tags:

<SharePointWebControls:SPGridView runat="server" ID="MyGridView" DataSourceID="dataSourceLinks" AutoGenerateColumns="false" EmptyDataText="<p><i>Not got any links.</i></p>">
         <asp:BoundField HeaderText="Title" DataField="Title" />
         <asp:BoundField HeaderText="Link" DataField="Link" />

Or via C# code, or a combination thereof.

| improve this answer | |

I don't know if this is what you are looking for, but it's a start - http://msdn.microsoft.com/en-us/library/ms752213.aspx

| improve this answer | |

SPGridView has much less functionality than GridView, I found it frustrating to work with in SharePoint 2007 in terms of presentation. This is a great intro and here is help on filtering

| 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.