This is an alternative to Jussi Palo's answer, but without iterating through ALL the list items, which is a huge performance loss.
string filtervalue = TextBox1.Text; // Value you selected, criteria for deletion.
SPWeb currentWeb = SPContext.Current.Web;
SPList list = currentWeb.Lists.TryGetList("MyList");
if(list==null)
throw new InvalidOperationException("MyList does not exist on current site.");
SPQuery query = new SPQuery()
{
Query = string.Format("<Where><Eq><FieldRef Name='MyField' /><Value Type='Text'>{0}</Value></Eq></Where>", filtervalue),
ViewFields = "<FieldRef Name='ID' />",
ViewFieldsOnly = true
};
SPListItemCollection filteredItems = list.GetItems(query);
foreach (SPListItem item in filteredItems)
{
item.Delete();
break; // If you want to delete ONLY the first occurence.
}
list.Update();
Also, if by any chance you know the ID of the item you selected, you can pass that as a parameter to the following method:
list.Items.DeleteItemById(SelectedId);