New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Deleting

The Deleting server event fires in one of the following cases:

  • During transfer - when the AutoPostBackOnTransfer="True" and the user tries to transfer an item / items. It fires after the Transferring server event (if not cancelled) once for all selected items. If this event is not cancelled and the AllowAutomaticUpdates="True" - the database is updated to reflect the new list.

  • On item delete - when the AutoPostBackOnDelete="True"

The event handler receives two parameters:

  1. The instance of the listbox firing the event

  2. An event arguments parameter containing the following properties:

  • Items - collection of all RadListBoxItem objects which will be affected by the transfer / deletion.

  • Cancel - set it to True to cancel the event and prevent the deleting to happen

protected void RadListBox1_Deleting(object sender, RadListBoxEventArgs e)
{
    Label.Text = "Deleted items count is " + e.Items.Count.ToString();
}
Protected Sub RadListBox1_Deleting(sender As Object, e As RadListBoxEventArgs)
    Label.Text = "Deleted items count is " + e.Items.Count.ToString()
End Sub

See Also

In this article