SPWeb web = SPContext.Current.Web;
SPList list = web.Lists["MyList"];
if (list != null)
{
for (int i = list.ItemCount - 1; i >= 0; i--)
{
list.Items[i].Delete();
}
list.Update();
}
I have more Items in an sharepoint list then when i in an listbox select only one item and delete if with the following code , then it deletes al the items in my list , not just the only i have selected , can somebody help me ?