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

learn more… | top users | synonyms

10
votes
3answers
13k 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 ...
6
votes
2answers
1k views

how to set list alert using javascript in sharepoint 2010?

I need to set a list alert for current (logged in) user using javascript. var currentcontext = new SP.ClientContext.get_current(); var currentweb = currentcontext.get_web(); ...
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 ...
5
votes
2answers
380 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. ...
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) ...
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 ...
4
votes
4answers
814 views

Programmatically adding SharePoint Lists to external SQL database

I need to export a SharePoint list to an external SQL database. My initial idea is to open the list as a datatable and bulk update. I created a console app I can run anytime I need to sync the data. ...
4
votes
4answers
74 views

Does SPList.ItemCount equal SPList.Folders.Count plus SPList.Items.Count?

I'm trying to do some inventorying of SharePoint 2007 content and have been scratching my head over this for a while now. I understand from MSDN that SPList.ItemCount counts all folders and items ...
3
votes
2answers
6k 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?
3
votes
5answers
4k views

How do you hide a hidden list?

If you set the SPList.Hidden property to true, the list isn't shown in the Quick Launch, All Site Content, Lookup lists, etc. However, it is still possible to navigate to the list by typing in the ...
3
votes
4answers
423 views

SharePoint List / Library property bag

I'm working with sharepoint 2007 and i have a question, does a sharepoint library / list has something like property bag, where i could store some properties for the list? Like a SPWeb object. Or ...
3
votes
1answer
1k views

Is it possible to update a list's icon?

Is there a way to update a list's icon? I was looking to use SPList.ImageUrl, but this is read only. The problem is that I've updated a list definition's icon; unfortunately there several list ...
3
votes
1answer
345 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 ...
3
votes
1answer
222 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
0answers
161 views

SPGridView - How to make it look & feel like built-in SP grid

In C# code, I'm working with the SPGridView control to display list items from a list of type SPDocumentLibrary. It binds fine, but it looks totally plain and has basically no features. I would like ...
2
votes
2answers
992 views

How to find a file with name = X in a SPList

Looking for recommendations. Have a file in a document library with name x.txt. In a workflow code behind, I need to get the file to read its contents. What is the best/most efficient way to do ...
2
votes
2answers
3k 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
1k views

List.AddItem() and List.Item.Add() … why two methods for same purpose

I searched and got the difference between List.AddItem() and List.Item.Add(). SPList.Add() vs SPList.AddItem() SharePoint 2010 Now the query which comes to my mind is that why Sharepoint has two ...
2
votes
1answer
95 views

Changed URL to pages, but still redirects to Pages?

I have an external website which needs to show URL in lowercase only. I don’t want to use URL Rewrite or any third party tool. Instead we decided to change the actual URL’s of the Pages Library. I’ve ...
2
votes
1answer
212 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"]; } ...
2
votes
2answers
176 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 ...
2
votes
1answer
401 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 ...
2
votes
1answer
89 views

SPListDataValidationException in an event receiver on a task list with Overdue tasks

I have a task list called Finance Department Tasks on this task list i have created an item updating event receiver which checks if all fields in the task list are filled and then sets the task status ...
2
votes
2answers
124 views

Unable to set permission on list for multiple spgroup

I have a list to which I want to set permission to 2 site groups. Among them, one is contribute level and second is read. My code for assigning the permission to list is: private void ...
2
votes
1answer
634 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 ...
2
votes
2answers
119 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
257 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 ...
2
votes
0answers
139 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 ...
2
votes
1answer
274 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 ...
1
vote
2answers
195 views

Why does SPList.GetItems(string fields[]) return more fields than specified?

I'm using SPList.GetItems(string fields[]) to obtain only specific item fields from a document library: SPListItemCollection items = list.GetItems("UniqueId", "Name"); However, iterating the items ...
1
vote
3answers
677 views

is this causing memory leaks?

I have a couple of utility functions that help with querying lists and wanted to see if they I wrote them would cause either memory leaks or cause the client code to try to access already disposed ...
1
vote
2answers
1k 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
2answers
245 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 ...
1
vote
2answers
214 views

View aggregations programmatically

I have a view in my list, I defined aggregations in my view: sum and average of several columns. Now I want to get programmatically the aggregations results. How can I get it?
1
vote
1answer
2k 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 = ...
1
vote
1answer
995 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 ...
1
vote
1answer
264 views

Alternative to CSOM ListItem.get_item

The only way I know to load a sharepoint list via Javascript is to load it and on the current list item: var value = currentItem.get_item(columnTitle); I want to be able to load an item and on the ...
1
vote
1answer
89 views

give user full rights on a list via powershell

I have messed up my rights on a list, so I can still view it, but cannot edit it. I need full permissions on it again. Is there a way to set my admin account back to full rights via powershell? ...
1
vote
2answers
576 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
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.
1
vote
3answers
715 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 ? ...
1
vote
3answers
1k views

Unable to programatically update list title

If I use using(SPSite site = new SPSite("http://somwewb")) { using(SPWeb web = site.OpenWeb()) { SPList lst = web.Lists["My custom list"]; lst.Title = "My custom list 2"; ...
1
vote
3answers
3k views

ListAdded is not firing when list is created by code

I have an SPListEventReceiver that handles the ListAdded event. If checks that the list is a Document Library, and then adds some fields to the library: public class ListEventReceiver : ...
1
vote
2answers
57 views

Replacement for Item Level Permissions

I have a SharePoint calender list and where i have given item level permissions for each event through designer workflow using the impersonation step. But now on the production site the number of ...
1
vote
1answer
41 views

How to embed SPList to a custom application page?

I have a custom central admin list and would like to insert it to a custom application page in a way that would make it look exactly like it does if you access the list via its URL - i.e. it should ...
1
vote
3answers
109 views

Cannot iterate subfolders of a very large folder

I have working code that is to iterate lots of folders in our (rather large) document archive, but one folder (which happens to have a very large amount of subfolders) does not allow me to iterate it. ...
1
vote
2answers
821 views

How to create tempary hidden field or variable in infopath that not going to add to SP List

I want add tempary variable or field to Infopath Brower Form to hold some information i want to set by rules. So i dont need this field in my sharepoint list.. Is there any way to do this without ...
1
vote
1answer
111 views

In SharePoint 2010, is there a way to stop one user from subscribing to list alerts?

For example, when a list is updated, a user can subscribe to the list so they get emails about the changes to the list. I can remove a user from getting those alerts, but the user can simply go back ...
1
vote
2answers
237 views

Deleting all items from a list and then adding new items will not give the new items id 1,2,3 etc

I have a list with 3 items. When I delete these 3 items and add new items they get ID 4, ID 5 and ID 6. But I want the new items to get ID 1, ID 2, and ID 3. Is there any workaround? This is how I ...