SPList represents a list on a Microsoft SharePoint Foundation Web site.

learn more… | top users | synonyms

4
votes
2answers
1k views

Using PowerShell how do I change the column ordering for a SharePoint List

Been trying to search for the answer to this, what I need to do is re-order the fields of a SharePoint list and propagate that change down to 300+ sites (should have used a content type, but oh well) ...
0
votes
2answers
1k views

Creating SSRS report in SharePoint 2010 with multiple SPLists

I have SP Lists Students: StudentID, Name, Address,Email Course: CourseID, Name, Duration, Fees StudentCourse: StudentID, CourseID How can I query these lists and create a SSRS report displaying ...
0
votes
1answer
59 views

Display a list as readonly regarless of permission level

I am currently trying to display a list view outside of its site collection. This has been done using String str = mySPView.RenderAsHtml(); Controls.Add(new LiteralControl(str)); Since it is ...
1
vote
0answers
192 views

SPSiteDataQuery without subfolder items?

I'm trying to use the SPSiteDataQuery to return the contents of several lists across a site collection. The problem I'm having, though, is that while there are only a few documents at the root level ...
1
vote
2answers
896 views

Add/Copy SPListItem object to Sharepoint List

explanation: I have fetched list items based on conditions. Like this. var query = from SPListItem oItem in splist.Items where ...
1
vote
1answer
1k views

How to Set SPQuery.RowLimit to get all items?

I'm using my SPList View to get the html code of extracted items by an SPQuery over the listview SPList myList = mySite.RootWeb.Lists.GetByInternalName("ListINStr"); SPView oView = ...
0
votes
1answer
539 views

Sharepoint Designer SPList option “Hide from browser” in code?

When I hide the list using list.Hidden = true; It's hidden from the Quick Launch and it's also hidden from the Sharepoint Designer. I'm rather interested in a useful feature for lists in ...
5
votes
2answers
351 views

SPQuery returning different before and after using RunWithElevatedPrivileges method

I am having a huge problem here. I am executing a query looking for a SPListItem, when I execute this query with user identity it works well, retuning the fields "Author" and "Editor" that I need. ...
2
votes
1answer
569 views

SPField not visible on default view when SPList created programatically

I'm creating an SPList item programatically. Everything goes fine, I add a list, I add spfields to it. SPList list = (SPList)oWeb.Lists[listName]; SPField libraryNameField = new ...
5
votes
3answers
3k views

How to bind dropdownlist from splist column with choice field using C#

Here is my list with name "Department" and name,mobile these are my column name and i want to add to my dropdown list only mobile number(column)plz help me ... SPSite site = new ...
4
votes
1answer
3k views

How to get Attachment URL Programatically From Sharepoint ListItem?

How to get Attachment Full URL Programatically From Sharepoint ListItem? Explanation: I have adding new item with attachment. Now i have to bind that attachment link to grid. When click on that link ...
1
vote
2answers
2k views

Add New Item Link not appear in Sharepoint List

Add New Item Link not appear in Sharepoint List. I logging with admin account(having full control). How to resolve ?
2
votes
1answer
197 views

Will using a `SPList` object derived from a disposed `.OpenWeb()` cause errors?

Will using a SPList object derived from a disposed .OpenWeb() cause errors? SPList list = null; using (SPWeb web = SPContext.Current.Site.OpenWeb("/myweb")){ list = web.Lists["Awesome Name"]; } ...
1
vote
2answers
1k views

GetDataTable from SPListItemCollection

My question is regarding the use of DataTable vs ListItemCollection. Basically I have a small solution, where I have to loop through the items in the list to verify if the items already exists or not. ...
2
votes
2answers
115 views

Getting latest datetime from a splist

I have sharepoint list with data and one of the columns contains date ... how can i programmatically retrieve the latest date, the field is a Date And Time type?
2
votes
2answers
162 views

Retrieving the highest value from list

My question is regarding retrieving a value from a sharepoint list. Basically I have a list with some data. One of the fields in the list is a text field with numbers. So what i want to do, i want to ...
3
votes
1answer
203 views

Update SPList.TemplateFeatureId

I need to update the TemplateFeatureId for a couple of lists in our SharePoint 2010 installation. The current TemplateFeatureId points to a feature that is no longer installed in the farm. Both ...
3
votes
2answers
5k views

How to change internal field name(column name) of sharepoint list?

Can we direct change it from sql database? if yes then how? or any other solution?
1
vote
2answers
225 views

How to create a custom SPList without saving it on the SPSite

I am trying to create a webpart which loads document information from a different application. I want this information loaded into a list which looks like a SharePoint list. I was able to create a ...
0
votes
1answer
661 views

SPDataSource for asp gridView returns nothing?

I'm binding my SPDataSource to an ASP:DataGrid but it returns empty gridview not filled. Here's my aspx file <SharePoint:SPDataSource runat="server" ID="SPTypes" DataSourceMode="ListItem" ...
1
vote
1answer
457 views

How to filter a sharepoint list

I have a custom list called expenses. The list has fields such as user,date,amount etc. I want the user to be able to filter this list by amount e.g. add a dropdown above the list with a search ...
0
votes
0answers
85 views

Proper way to get all lists of a certain type from an entire site collection regardless of current location

I'm creating a webpart that gives the user a feed of any annoucement list in the entire site collection, so they can aggregate data to a central portal. I'm currently using the following, but can't ...
0
votes
1answer
622 views

selected SPListItem in the current list

how to get the selected SPListItems in the current SPList ? I thought I would find a helping property like this: SPListItemCollection mySelectedItems = ...
0
votes
2answers
639 views

How to get a SPList's default edit SPForm programatically?

I have created a new edit form for my SPList via Sharepoint Designer and haven't deleted the old ones. I know how to get all the forms, but how to distinguish default forms from the rest? I can see ...
1
vote
1answer
147 views

difference between item[] and item.fields[]

I want to retrieve let's say the title field of my item so what's the différence between doing these acces methods : SPList myList = properties.List; string mytitle1 = ...
0
votes
4answers
403 views

Safely return all lists in site collection that match criteria

I'm using the following code to get all "Announcement" lists in a Web Applications site collection. Unfortunately, sometimes the current user does not have permission to that site and the page fails ...
0
votes
0answers
1k views

SPList multiple content types - “Column does not exist” error

I'm using the Publishing feature of SharePoint. I have a custom Content Type that inherits from the ArticlePage Content Type, and is bound to the Pages list of a given site. My custom Content Type ...
0
votes
1answer
470 views

New SPField shows in the view of my SPList but doesn't appear in any forms (edit, new)

I add a new column to a SharePoint list (the list is built on a content type) like this: SPField textfield = list.Fields.CreateNewField(SPFieldType.Text.ToString(), "new column"); ...
0
votes
2answers
1k views

Get all SPLists for a site collection

I feel like I'm very close on this one. I know how to get the root site collection from this: How can I get the root site collection from SPContext.Current? I've been messing around with ...
1
vote
2answers
519 views

Sort SPList on derived value of e.g. SPFieldUser column

What I want to achieve is: get a bunch of SPListItems from an SPList, using SPQuery, and have the items ordered by an SPFieldUser column. Just referencing the SPFieldUser column appears to sort on the ...
1
vote
0answers
62 views

SPList Replacelink method

I am trying to find and replace url links in sharepoint lists. The ReplaceLink method(SPList class) does the job for straight forward urls like "www.google.com/test" but truncates the url parameter ...
1
vote
2answers
154 views

Dynamically assemble CAML to call related List Items?

I have good methods in place to get my core List of Posts. Let's say I get the 100 most recent Posts. I'd like to get all comments related to those posts. Comments have a field called PostID that ...
2
votes
0answers
126 views

Is my Object Casting Model acceptable?

I'm creating a SharePoint application, and am trying some new things to create what amounts to an API for Data Access to maintain consistency and conventions. I haven't seen this before, and that ...
1
vote
0answers
42 views

Is my Data Access model acceptable?

I'm creating a SharePoint application and want to do things the right way as often as possible. I'm deploying a series of Lists in a Site Definition, and I want to lock down Data Access to a series ...
2
votes
2answers
233 views

QueryThrottleMode in non-query operations?

I have a big List which I want to empty. Therefore I create a template from that list, delete the list and create a new list from the template I just saved before. I know there are other ...
0
votes
1answer
674 views

SharePoint: Move SPListItem inside folder to root and set lookup field value

Dear stackoverflow members, Maybe someone knows a solution for our task: Given a custom list with folders for countries: ListA ---FolderA (Title: "USA") ------Item1 ------Item2 ------Item3 ...
2
votes
1answer
253 views

Add content types programmatically into SPList takes too long

I've dozens of CTypes to add to an SPList programmatically (cause content types are provided by CTH) and each oSPList.ContentTypes.Add() takes almost 1sec. Is there any other approach ou code ...
0
votes
1answer
557 views

Proper use of SPWeb from SPContext for pulling lists

So, after about two hours on the subject I am thoroughly confused. There are viewpoints all over the place on how, when, and why to use Dispose() on SPWeb objects as they relate to SPContext. Can ...
3
votes
1answer
318 views

ProcessBatchData - update a currency field

I'm using SPWeb.ProcessBatchData to update list items, and I'm having a problem with currency field. When I insert something like this <SetVar ...
1
vote
2answers
2k views

update SPList using csv via Powershell

knowing that is possible in PS, exporting SPList items to PS objects(link1 link2) what is the best way, to go into the other way: Create/Update an SPList from an exported csv or format-table.
9
votes
3answers
11k views

Fastest way to delete all items with C# [duplicate]

Possible Duplicate: Deleting all the items from a large list in SharePoint What is the fastest way to delete all items in a list programmatically? I do not want to remove list and re-create ...
2
votes
1answer
359 views

get hold of a list

$web gives me the title of the website $list is not giving me any and therefore item add/update i m doing is failing. What is wrong? The code works in dev area. btw, I am running with full rights on ...
1
vote
1answer
131 views

Getting library field parameters when inherited from a site column

The SetUp I have created 3 site columns. All set to not required fields. I have added these site columns to a content type. This content type I have added to a document library. The document library ...
1
vote
1answer
1k views

How do I get values of fields from custom lists?

I have a custom list ("Contacts") as well as a web part with forms. I want to take the custom list fields and map them to the web part form. My problem is getting the values from the custom list. I've ...
1
vote
3answers
646 views

Item-Level Security Boundaries

Item-Level security boundaries are defined in the Software boundaries document at 1000 items. In the Advanced List Settings you can specify Item-level Permissions to "Create items and edit items that ...
1
vote
1answer
2k views

Share List between subsites of sharepoint2010

Anyone know how can we share one subsites list to another subsite ? I want to allow all operations also and also want to put in read only mode in another subsite. Anyone have idea how can i do this ? ...
0
votes
1answer
394 views

field type URL. how to prepare csv for this?

I am running a powershell to import csv into a list. There is one field "ProviderURL" in the list. In the csv I had http://www.contoso.com and it imported fine. Howerver, I would like it to be Contoso ...
0
votes
1answer
344 views

Changing SPField cause no changes

I try to change an SPField after SPList creation, but I'm not getting any results of that change. using this code: SPField oSPField = oSPList.Fields[new Guid("MyFieldGuid")]; ...
1
vote
1answer
926 views

When to use List<SPList> vs SPListCollection?

If I have to grab numerous lists which I have the name, URL or Guid of, should I use web.Lists and return the entire SPListCollection or grab the specific ones I need via web.Lists[Guid] and place ...
0
votes
3answers
296 views

Tool to get SPList in webpart using tool

I want to get SPList data in webpart just passing name in tool. Anybody have any idea about that?Please Suggest me.