SPList represents a list on a Microsoft SharePoint Foundation Web site.
5
votes
3answers
4k 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 ...
5
votes
2answers
366 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
2answers
139 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();
...
4
votes
2answers
199 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.
...
3
votes
4answers
101 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 ...
2
votes
5answers
2k 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 ...
2
votes
2answers
511 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
1answer
85 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
47 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
230 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 ...
2
votes
1answer
192 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
396 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 ...
2
votes
1answer
75 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
69 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
135 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
1answer
156 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 ...
2
votes
3answers
470 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. ...
1
vote
2answers
875 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
399 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 ?
1
vote
3answers
441 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
135 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
1answer
554 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
43 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
344 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
1k 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
341 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
3answers
511 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
2k 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
330 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
94 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
121 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
97 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
464 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
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
0answers
23 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
28 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
2answers
277 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)
...
1
vote
0answers
115 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
191 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
55 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
91 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
39 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
396 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 ...
0
votes
4answers
261 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
482 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
2answers
38 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
69 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
343 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
499 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
493 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 ...



