Reputation: 5915
I have get all items of a share-point list. Requirement is to delete list items form listview. Plz guide me how it can be done ?
I have idea that it can be done by using checkbox in listview.
I am not getting how to get checked items in listview and how to delete checked items from share point list ?
Upvotes: 0
Views: 1341
Reputation: 100630
And if you are using SharePoint 2010 you can use client Object Model - here is howto for exactly your sceanrio: http://msdn.microsoft.com/en-us/library/ee539976.aspx
Johnv2020 answer shows 2 other ways of doing it:
Upvotes: 1
Reputation: 2146
You can just use the SPListItemCollection.Delete method (assuming you're using the api). If not then use can use Lists.asmx to delete. For example ssomething like the code below will work
SPWeb mySite = SPContext.Current.Web;
SPListItemCollection listItems = mySite.Lists["List1"].Items;
SPListItem item = listItems[k];
listItems.Delete(k);
Upvotes: 1