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

learn more… | top users | synonyms

1
vote
2answers
241 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 ...
2
votes
1answer
102 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 ...
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 ...
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(); ...
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. ...
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 ...
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 ...
3
votes
4answers
460 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 ...
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
1answer
93 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? ...
0
votes
1answer
365 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
38 views

Is there any programmatic way to determine if a list has any relationships to other lists?

If list A has a SPFieldLookup to list B is there any thing in list B's SPList object to show the relationship with list A? While I can flip through list A's fields and find the relationship to List B ...
4
votes
2answers
2k 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
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
60 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
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
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
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 = ...
0
votes
1answer
835 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
421 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
689 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
4answers
4k 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
4k 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 ...
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
228 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
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. ...
2
votes
2answers
122 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
191 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
238 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
7k 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
257 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
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" ...
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 ...
0
votes
0answers
97 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
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 ...
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 = ...
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
0answers
2k 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
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
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
597 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
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
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 ...
2
votes
0answers
144 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
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 ...
2
votes
2answers
281 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
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 ...
2
votes
1answer
276 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 ...