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

learn more… | top users | synonyms

1
vote
2answers
240 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 ...
1
vote
2answers
2k 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. ...
1
vote
1answer
167 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 = ...
1
vote
2answers
166 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 ...
1
vote
1answer
136 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
0answers
28 views

how to implement picture library look and feel in provider hosted App?

How to implement the same view (design) of SharePoint list (picture or document library) in provider hosted App, for now I am using asp.net controls but the final view of app doesn't belong to ...
1
vote
2answers
75 views

Enable versioning on SPList programmatically

I might be missing something obvious, but I am trying to enable version history on a regular task list programmatically. It is definitely possible from the UI, but how can this be achieved in code? I ...
1
vote
0answers
33 views

Replace default List View Web Parts

As the title explains, I am trying to remove the default Web Parts that are associated to list items and replace them with my own custom web parts. Here is what I've attempted so far: SPList list = ...
1
vote
0answers
100 views

How do I make a dynamically created SPList read-only in browser, but editable in code?

In code, I create a SPList. I write to this list programatically, but I would like the list to appear read-only for all users (perhaps excluding admins only) in browser only, i.e. I don't want to ...
1
vote
1answer
448 views

How to get username through REST

I am currently working with a task where you have a SPList in one farm that holds some data that we need to aggregate into a view on another farm. Therefore I am working on a Visual Web Part that ...
1
vote
1answer
31 views

Is there a setting that determines the default root folder of a freshly-created SPList?

I noticed that when I create lists on my development site(s), they're created right in the site's root (in other words, URLs look like xxx/sites/DEV/DocLibX). The last time I looked (a few days ago), ...
1
vote
0answers
84 views

Using DefaultNewFormUrl's link on Document Library opens item on save

As our company tries to move away from the folder structure and into a tag-driven structure we were left with a dilemma. Users can only add content to folders/libraries yet they don't want to have to ...
1
vote
0answers
40 views

'E-Mail a Link' Ribbon Button generates a wrong URL on Grouped Views

When a Grouped View is defined in a List View Web Part, the OOB Ribbon Button 'Email a link' on a List/Library Context Tab, generates an incomplete URL (only Web Application URL) Override the Ribbon ...
1
vote
0answers
88 views

External lists: Field GUIDs always empty?

I want to turn an external list into a DataTable using the ID/GUID values of external list's Fields as the DataTable column names; however, I've noticed for the external list I'm using, all of the ...
1
vote
0answers
83 views

Remove ECB from XsltListViewWebPart

I have created XsltListViewWebPart programatically. I want to remove ecb on list items, I know this can be done by changing xsl of the webpart but I am getting null in it. Is there any way to do this? ...
1
vote
0answers
201 views

Append Changes to Existing Text of Multiline of text field set “No” after create new site from template

Description: i have a site, and it contains a list. in that list, multiple line of text description field. set append changes to existing text of that description field is "Yes" now i creating site ...
1
vote
0answers
210 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
1answer
572 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 ...
1
vote
0answers
65 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
0answers
43 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 ...
0
votes
2answers
51 views

How retrieve custom fields only when using SPListItemCollection?

Hi with following code I am retrieving a DataTable from a List: using (SPSite site = new SPSite("http:...")) { using(SPWeb web = site.OpenWeb()) { ...
0
votes
4answers
425 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
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 ...
0
votes
1answer
49 views

Sharepoint 2013 c# customise field data depending on user connected properties

I have some specific need here, and i don't know how to approach it. I explain : I have a SharePoint list to which i am adding a field in feature activated event reciever. I am adding a 3 choices ...
0
votes
1answer
74 views

Where does a list item go when it is deleted using Server Object Model?

Assumptions: I have a custom SharePoint list with 2 items in it. In one case i delete one item from the list manually and check the recycle bin,here i find the deleted item. Now in the second case i ...
0
votes
3answers
785 views

JSLink set in list definition (schema.xml) not being loaded

I have created a custom list definition and detailed in many articles across the net I have specified my file in the JSLink property of the view. For some reason it is no longer working. <JSLink ...
0
votes
2answers
250 views

add SPListItem with more than one field of data

I want to add an item to a SharePoint task list, with data in the Title, AssignedTo, and Status columns. The code below adds the item with data in the Title column, but no data in the other columns. ...
0
votes
1answer
364 views

How to retrive sharepoint list data using Search query in sharepoint 2010?

Currently i receiving data from sharepoint list using CAML and Linq. but now requirement is to retrive data from sharepoint list using search query. can anyone give examples or good articles to ...
0
votes
1answer
755 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" ...
0
votes
4answers
847 views

Fetch SPList items from another siteCollection - problem with xml

Trying to fetch all list items from a list located in a different site collection and traverse the list items, reading some of their column values. I've taken some code from an example snippet that ...
0
votes
1answer
632 views

Is there a property to get all subitems/subfolders from a SPListItem?

I need to find out how many subitems and subfolders a SPListItem has. The fields ItemChildCount and FolderChildCount are no solution for me, because they only count the folder/item directly beneath ...
0
votes
1answer
331 views

SharePoint List View - Export to Excel with Formatting and Grouping

I have a SPList View with 2 levels of grouping. First level is Company and the second level is 'Month - Year' which is a calculated field. Below is the view's screen shot: The issue is when a do ...
0
votes
1answer
176 views

List Enable Throttling using Server Object Model

Consider the following code, It is querying to a list called Employee Information which has about 23000 items, i.e it has crossed the list view threshold set by the administrator. ...
0
votes
1answer
216 views

Adding an splist instance to an Application page programmatically through xaml/backend c#

I have created a custom list which I wish to put inside an application page, since I wish to be able to filter what is shown inside the list to the content which is related to the user. Is there any ...
0
votes
1answer
107 views

Add additional user information to SPList as list column

I have a List Tickets with a field Client. This is a user from our AD and displays the name of the user. We now need to display the country and the location the user resides in to additional fields. ...
0
votes
2answers
774 views

ItemEventReceiver - ItemDeleting not working with a document library and referencing list

I have a custom list that has a GUID column which refers to the UniqueId of a document in a document library. Every time I upload a document, it should add an entry in this list and populate the ...
0
votes
1answer
345 views

Which of these is the best way to get a list item collection?

Performance-wise which of these methods is the best way to get a list item collection, and why? SPList list = web.getlist("listurl"); SPListItemCollection items = list.getItems(query); ...
0
votes
1answer
96 views

Best way to update 200 items on a list [closed]

Situation in a VS2010/SP2010 site: List A with main items List B with subitems, having a lookup column that points to List A ID There are about 200 subitems for each item The Page where users edit ...
0
votes
1answer
235 views

How to use dynamic or relative path in SPList object?

I am using the following code to read a picture library: SPList list = SPContext.Current.Web.GetList("http://win-12/sites/mysite/ImageLibrary") Problem is, in above code "win-12" is my machine name ...
0
votes
2answers
2k 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
768 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
731 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 ...
0
votes
1answer
567 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
1answer
741 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 ...
0
votes
1answer
654 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 ...
0
votes
1answer
387 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")]; ...
0
votes
3answers
317 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.
0
votes
0answers
20 views

Why is my list total showing as “Count= undefined”?

I'm updating a view on an existing list programmatically but I can't get the aggregation to work correctly. I'm setting it as follows (the values are pulled from an xml site definition): if ...
0
votes
0answers
12 views

Same question but different column names

Im sorry for bothering you again but when I tried the same formula but different column names it did not work... Column names for example are: F1 Makeup (26),F1 bridge tap (26),F2 bridge tap (26),F1 ...