Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am having a big trouble with showing data in a gridview.

All the guides on the internet is using LINQ, but i can not use that, because i create new Lists in Sharepoint, that therefore would not be in the entity class file.

I would be really glad if somebody could show how to get data from a list and show it in a webpart wihout LINQ:

I have this now:

        SPSite _sc = SPContext.Current.Site;
        SPWeb _w = _sc.OpenWeb();
        SPList l = _w.Lists["Navne"];
        SPListItemCollection lic = l.Items;
        foreach (SPListItem item in lic)
        {
            item.Title.ToString();
        }

I have searched to find the solution, but no answers.

share|improve this question
    
all lists generate a webpart bound to this list. What's wrong with it ? –  Steve B Jun 25 '12 at 10:11
    
Because i will take multiple list and combine them into one. –  Kevin Simper Jun 25 '12 at 10:37
    
Is there any common content type ancestor? if yes, this can be native. which edition of SP do you own ? –  Steve B Jun 25 '12 at 10:59
    
I am using Sharepoint Online, so that must be Foundation. –  Kevin Simper Jun 25 '12 at 11:00
    
SharePoint Online uses SharePoint Server 2010 –  Vardhaman Deshpande Jun 25 '12 at 11:05

1 Answer 1

up vote 0 down vote accepted

In these 101 samples from Microsoft there is an example on how to use the Gridview.

http://code.msdn.microsoft.com/office/SharePoint-2010-101-Code-da251182#content

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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